mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
zero reference when object is collected
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27704 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
622fe7971f
commit
1830f185a4
3 changed files with 20 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2009-01-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSValue.m: ([valueWithNonretainedObject:]) zero the reference
|
||||||
|
when the object is collected.
|
||||||
|
|
||||||
2009-01-25 Richard Frith-Macdonald <rfm@gnu.org>
|
2009-01-25 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSURL.m: Compatibility tweaks for a few MacOS-X oddities...
|
* Source/NSURL.m: Compatibility tweaks for a few MacOS-X oddities...
|
||||||
|
|
|
@ -90,8 +90,18 @@
|
||||||
* Ensure that the version encoded is that used by the abstract class.
|
* Ensure that the version encoded is that used by the abstract class.
|
||||||
*/
|
*/
|
||||||
[self setVersion: [super version]];
|
[self setVersion: [super version]];
|
||||||
|
#if TYPE_ORDER == 0 && GS_WITH_GC
|
||||||
|
GSMakeWeakPointer(self, "data");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TYPE_ORDER == 0 && GS_WITH_GC
|
||||||
|
- (void) finalize
|
||||||
|
{
|
||||||
|
GSAssignZeroingWeakPointer((void**)&data, (void*)nil);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Allocating and Initializing
|
// Allocating and Initializing
|
||||||
|
|
||||||
- (id) initWithBytes: (const void *)value
|
- (id) initWithBytes: (const void *)value
|
||||||
|
@ -99,7 +109,11 @@
|
||||||
{
|
{
|
||||||
typedef __typeof__(data) _dt;
|
typedef __typeof__(data) _dt;
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
#if TYPE_ORDER == 0 && GS_WITH_GC
|
||||||
|
GSAssignZeroingWeakPointer((void**)&data, (void*)(*(id*)value));
|
||||||
|
#else
|
||||||
data = *(_dt *)value;
|
data = *(_dt *)value;
|
||||||
|
#endif
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -756,8 +756,7 @@ static Class NSDataMallocClass;
|
||||||
*/
|
*/
|
||||||
if (c == nil)
|
if (c == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"Got nil when trying to unarchive class %s",
|
NSLog(@"Unable to find class named '%s'", className);
|
||||||
className);
|
|
||||||
}
|
}
|
||||||
[classInfo mapToClass: c withName: className];
|
[classInfo mapToClass: c withName: className];
|
||||||
[objDict setObject: classInfo forKey: className];
|
[objDict setObject: classInfo forKey: className];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue