GC bugfixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28062 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-03-10 11:30:16 +00:00
parent a9c800575e
commit 8bbcafb4c1
3 changed files with 33 additions and 8 deletions

View file

@ -746,26 +746,23 @@ static inline BOOL timerInvalidated(NSTimer *t)
NSObjectMapValueCallBacks, 0);
_timedPerformers = [[NSMutableArray alloc] initWithCapacity: 8];
#ifdef HAVE_POLL_F
#if GS_WITH_GC
_extra = NSAllocateCollectable(sizeof(pollextra), NSScannedOption);
#else
_extra = NSZoneMalloc(NSDefaultMallocZone(), sizeof(pollextra));
memset(_extra, '\0', sizeof(pollextra));
#endif
#endif
}
return self;
}
- (void) dealloc
{
[self finalize];
[super dealloc];
}
- (void) finalize
{
#ifdef HAVE_POLL_F
if (_extra != 0)
{
pollextra *e = (pollextra*)_extra;
if (e->index != 0)
NSZoneFree(NSDefaultMallocZone(), e->index);
NSZoneFree(NSDefaultMallocZone(), e);
@ -777,6 +774,7 @@ static inline BOOL timerInvalidated(NSTimer *t)
NSFreeMapTable(_contextMap);
}
RELEASE(_timedPerformers);
[super dealloc];
}
/**