Re: Double free invisible due to autorelease pool

David Ayers <[email protected]>
Newsgroups gmane.comp.lib.gnustep.user
Message-ID <[email protected]>
Sébastien Pierre wrote:

> Hi Richard, Adam,
> 
> First, thanks a lot for your answers !
> 
> Le 2 févr. 05, à 22:19, Adam Fedor a écrit :
> 
>>>> I am currently in big trouble trying to find the cause of a "double 
>>>> free" which occurs when releasing an autorelease pool. Has anybody 
>>>> any idea to know how to identify where an autoreleased objects was 
>>>> freed (released, I guess) before being autoreleases ?
>>>
>>>
>>> [NSObject+enableDoubleReleaseCheck:] might well help you.
> 
> 
> This helped me to see that there is actually a double release check, but 
> I would like the debugger to break on the raising of the 
> "NSGenericException". On OSX, there is the "NSHangOnUncaughtException = 
> YES;" provided by NSDebug, but it does not seem to be on GNUstep :/
> 
> Is there any workaround ?
> 

Couldn't you simply set a breakpoint on -raise?  And if you really only 
want it in NSGenericException, then hack -raise to test the name and 
call a dummy function for which you have set breakpoint on a match.

Cheers,
David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.