release & memory problem
release & memory problem
- Subject: release & memory problem
- From: Lloyd Dupont <email@hidden>
- Date: Fri, 2 May 2003 14:12:23 +1000
I have some memory problem :-0 (maybe age ?)
I have a small tool which exit on a SIGSEGV signal when I release the
memory pool.
apparently while trying to delete an (unknown to me)
"NSPlaceholderMutableDictionary" instance.
so I try to figure out when this class is allocated and deallocated by
posing this above class
@implementation DebugObject
- (oneway void) dealloc
{
NS_DURING
const char * cname = isa->name;
if(! strcmp(cname, "NSPlaceholderMutableDictionary")) {
printf("[%s dealloc]\n", cname);
}
NS_HANDLER
NS_ENDHANDLER
[super dealloc];
}
+ alloc
{
NS_DURING
const char * cname = ((Class) self)->name;
if(! strcmp(cname, "NSPlaceholderMutableDictionary")) {
printf("[%s alloc]\n", cname);
}
NS_HANDLER
NS_ENDHANDLER
return [super alloc];
}
@end
as NSObject
int main (int argc, const char * argv[]) {
#if DEBUG
[DebugObject poseAsClass: [NSObject class]];
#endif
the problem is....
it seems this object is never allocated !
and it SIGSEGV at deallocation with a very short call stack (on
NSAutoreleasePool() above it)
I have carefully look at all my retain/release/autorelease (not too
hard it's small tool), they looks good, so far ...
any other tip/ideas for debugging ?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.