minor osx compatibility tweak

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31999 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-02-04 22:46:08 +00:00
parent 8574a1d8de
commit fe3f6c7d60
2 changed files with 22 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2011-02-04 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSConcretePointerFunctions.m: objects with weak memory should
not be retained.
2011-02-03 Philippe Roussel <p.o.roussel@free.fr>
* Source/NSPropertyList.m: Fix memory leaks.

View file

@ -225,7 +225,14 @@ relinquishRetainedMemory(const void *item,
}
else if (options & NSPointerFunctionsObjectPointerPersonality)
{
_x.acquireFunction = acquireRetainedObject;
if (options & NSPointerFunctionsZeroingWeakMemory)
{
_x.acquireFunction = acquireExistingMemory;
}
else
{
_x.acquireFunction = acquireRetainedObject;
}
_x.descriptionFunction = describeObject;
_x.hashFunction = hashShifted;
_x.isEqualFunction = equalDirect;
@ -253,12 +260,20 @@ relinquishRetainedMemory(const void *item,
}
else /* objects */
{
_x.acquireFunction = acquireRetainedObject;
if (options & NSPointerFunctionsZeroingWeakMemory)
{
_x.acquireFunction = acquireExistingMemory;
}
else
{
_x.acquireFunction = acquireRetainedObject;
}
_x.descriptionFunction = describeObject;
_x.hashFunction = hashObject;
_x.isEqualFunction = equalObject;
}
return self;
}