mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
a3d6ab0806
commit
d70e36cea8
3 changed files with 13 additions and 19 deletions
|
@ -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:
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue