Add code to make allocation error tracking easier for Nikolaus Schaller

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37327 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-10-30 04:28:17 +00:00
parent 00963be77a
commit fda6ac643b
3 changed files with 48 additions and 14 deletions

View file

@ -543,3 +543,24 @@ static SEL objSel;
}
@end
@interface GSCachedDictionary : GSDictionary
{
BOOL _uncached;
}
@end
@implementation GSCachedDictionary
- (void) dealloc
{
if (NO == _uncached)
{
[NSException raise: NSInternalInconsistencyException
format: @"Deallocating attributes which are still cached"];
}
[super dealloc];
}
- (void) _uncache
{
_uncached = YES;
RELEASE(self);
}
@end