From 931eb3b58ca8292d795e951f07c2185cba8d9a86 Mon Sep 17 00:00:00 2001 From: mccallum Date: Wed, 6 Mar 1996 14:09:15 +0000 Subject: [PATCH] ([Encoder -_coderCreateReferenceForObject:]): Insert it in object_2_xref, not const_ptr_2_xref. ([Encoder -_encodeObject:withName:isBycopy:isForwardReference:]): Create the in_progress_table with NSNonOwnedPointerMapKeyCallBacks, not NSObject..; needed by distributed objects so we don't get infinite loop with proxy objects. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1059 72102866-910b-0410-8b05-ffd578937521 --- Source/Encoder.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Encoder.m b/Source/Encoder.m index 9d502c2db..dcf5f3315 100644 --- a/Source/Encoder.m +++ b/Source/Encoder.m @@ -244,7 +244,7 @@ my_object_is_class(id object) NSIntMapValueCallBacks, 0); } xref = NSCountMapTable (object_2_xref) + 1; - NSMapInsert (const_ptr_2_xref, anObj, (void*)xref); + NSMapInsert (object_2_xref, anObj, (void*)xref); } - (unsigned) _coderReferenceForObject: anObject @@ -623,7 +623,11 @@ my_object_is_class(id object) /* Register the object as being in progress of encoding. */ if (!in_progress_table) in_progress_table = - NSCreateMapTable (NSObjectMapKeyCallBacks, + /* This is "NonOwnedPointer", and not "Object", because + with "Object" we would get an infinite loop with distributed + objects when we try to put a Proxy in in the table, and + send the proxy the -hash method. */ + NSCreateMapTable (NSNonOwnedPointerMapKeyCallBacks, NSIntMapValueCallBacks, 0); NSMapInsert (in_progress_table, anObj, (void*)1);