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:
rfm 2011-02-04 22:46:08 +00:00
parent 30f3b2c03f
commit abbde1c543
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> 2011-02-03 Philippe Roussel <p.o.roussel@free.fr>
* Source/NSPropertyList.m: Fix memory leaks. * Source/NSPropertyList.m: Fix memory leaks.

View file

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