[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Segfault in -[NSObject dealloc]

From: Richard Frith-Macdonald
Subject: Re: Segfault in -[NSObject dealloc]
Date: Thu, 18 May 2006 06:18:54 +0100

On 18 May 2006, at 05:31, Michael Gardner wrote:

I'm allocating objects with class_createInstance(), storing them on a stack (well, just a plain NSArray), and popping them off at a later time. When I pop an object from the stack, it gets released (as I expect), but I get a segfault from -[NSObject dealloc] that I can't track down.

I'm pretty sure I'm not double-releasing the object since I've sprinkled printf statements in my dealloc methods, and I've tried looking through NSObject.m to find the culprit, but can't see where the segfault is coming from (the inline functions hinder debugging somewhat). What kind of things can cause segfaults in -[NSObject dealloc]? Could this be a GNUstep bug?

You can't use class_createInstance() to create instances of GNUstep classes (unless you build NSObject.m in the base library specially to permit it). The way to allocate OpenStep/GNUstep objects is using the NSAllocateObject() function.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]