• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Importing Word doc in Carbon app via Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Importing Word doc in Carbon app via Cocoa


  • Subject: Re: Importing Word doc in Carbon app via Cocoa
  • From: Michael Ash <email@hidden>
  • Date: Thu, 16 Apr 2009 11:38:19 -0400

On Thu, Apr 16, 2009 at 11:32 AM, Steve Mills <email@hidden> wrote:
> I'm not a Cocoa developer, so I rarely have to touch the stuff. This code
> used to work, and I'm not sure when or why it got broken. It previously did
> not have the NSApplicationLoad or NSAutoreleasePool, so I added those in
> hopes that that was the problem. Before adding those 2 things, I would get a
> crash down in some Cocoa stuff (see stack after routine). After adding those
> 2 things, it crashes at [localPool release]. I was told to use those 2
> things in a few other Cocoa routines we have in our Carbon app, and they
> still work (using NSCursor and NSAnimationEffectPoof).
>
> Any ideas on what might be wrong? I appreciate any help.

Your code is full of memory management errors. It is fairly amazing
that it ever worked. The lack of an autorelease pool probably covered
up the errors in exchange for leaking.

Anyway, read through this, and then fix up your code accordingly:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994-BAJHFBGH

The particular error you're making is releasing objects that you don't own.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Importing Word doc in Carbon app via Cocoa (From: "Steve Mills" <email@hidden>)

  • Prev by Date: Importing Word doc in Carbon app via Cocoa
  • Next by Date: Re: -viewDidMoveToWindow without subclassing? NSViewController?
  • Previous by thread: Importing Word doc in Carbon app via Cocoa
  • Next by thread: Re: Importing Word doc in Carbon app via Cocoa
  • Index(es):
    • Date
    • Thread