mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
More tweaks for garbage collection mode, including making NSNotificationCenter use weak pointers (things are never removed if it uses strong pointers because they remove themselves in the -dealloc method, which is never called, and can't remove themselves in the -finalize method because the -finalize method would not be called until after they have been removed - this is consistent with Apple behaviour).
Gorm now works correctly when built with GC enabled. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33109 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a439972605
commit
b08b2d0f34
7 changed files with 20 additions and 26 deletions
|
@ -575,11 +575,7 @@ failure:
|
|||
format: @"[%@-initWithBytes:length:] called with "
|
||||
@"length but null bytes", NSStringFromClass([self class])];
|
||||
}
|
||||
#if GS_WITH_GC
|
||||
ptr = NSAllocateCollectable(bufferSize, 0);
|
||||
#else
|
||||
ptr = NSZoneMalloc(NSDefaultMallocZone(), bufferSize);
|
||||
#endif
|
||||
if (ptr == 0)
|
||||
{
|
||||
DESTROY(self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue