mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Dealloc notification stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@5524 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5837aeb214
commit
c06187dbf2
3 changed files with 41 additions and 3 deletions
|
@ -661,6 +661,23 @@ static BOOL double_release_check_enabled = NO;
|
|||
NSDeallocateObject (self);
|
||||
}
|
||||
|
||||
static BOOL deallocNotifications = NO;
|
||||
|
||||
- (BOOL) deallocNotificationsActive
|
||||
{
|
||||
return deallocNotifications;
|
||||
}
|
||||
|
||||
- (void) setDeallocNotificationsActive: (BOOL)flag
|
||||
{
|
||||
deallocNotifications = flag;
|
||||
}
|
||||
|
||||
- (BOOL) _dealloc
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- free
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
|
@ -1029,7 +1046,12 @@ static BOOL double_release_check_enabled = NO;
|
|||
}
|
||||
|
||||
if (NSDecrementExtraRefCountWasZero(self))
|
||||
[self dealloc];
|
||||
{
|
||||
if (deallocNotifications == NO || [self _dealloc] == YES)
|
||||
{
|
||||
[self dealloc];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue