always create autorelease pools for mixed GC mode support

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33212 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-05-31 07:55:06 +00:00
parent ba24ce0841
commit a69b7c2466
3 changed files with 13 additions and 19 deletions

View file

@ -1,3 +1,9 @@
2011-05-31 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/GNUstepBase/GNUstep.h:
Deprecate autorelease pool macros and make them always create the
pool.
2011-05-31 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSHashTable.h:

View file

@ -61,14 +61,6 @@
#define DESTROY(object) object = nil
#endif
#ifndef CREATE_AUTORELEASE_POOL
#define CREATE_AUTORELEASE_POOL(X)
#endif
#ifndef RECREATE_AUTORELEASE_POOL
#define RECREATE_AUTORELEASE_POOL(X)
#endif
#define IF_NO_GC(X)
#else
@ -158,29 +150,25 @@ id __object = (object); (__object != nil) ? [__object autorelease] : nil; })
})
#endif
#define IF_NO_GC(X) X
#endif
#ifndef CREATE_AUTORELEASE_POOL
/**
* Declares an autorelease pool variable and creates and initialises
* an autorelease pool object.
/** DEPRECATED ... use NSAutoreleasePool *X = [NSAutoreleasePool new]
*/
#define CREATE_AUTORELEASE_POOL(X) \
NSAutoreleasePool *X = [NSAutoreleasePool new]
#endif
#ifndef RECREATE_AUTORELEASE_POOL
/**
* Similar, but allows reuse of variables. This destroys the old pool before
* creating the new one.
/** DEPRECATED ... use [X release]; X = [NSAutoreleasePool new]
*/
#define RECREATE_AUTORELEASE_POOL(X) \
DESTROY(X);\
X = [NSAutoreleasePool new]
#endif
#define IF_NO_GC(X) X
#endif
/**
* <p>

View file

@ -163,7 +163,7 @@ static Class PoolClass;
- (void) dealloc
{
[NSException raise: NSGenericException
format: @"dealloc should not be called in garbage collected mode"];
format: @"dealloc should not be called in garbage collected mode"];
GSNOSUPERDEALLOC;
return;
}