Re: Importing Word doc in Carbon app via Cocoa
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