URL:
<http://savannah.gnu.org/bugs/?27128>
Summary: rootProxy cannot be called twice on an NSConnection
Project: GNUstep
Submitted by: mjohnston
Submitted on: Tue 28 Jul 2009 03:27:16 PM GMT
Category: Base/Foundation
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Library Version - gnustep-base-0.19
OS - Fedora Core 10
gcc - 4.1.2
The expected behaviour is that you can call rootProxy multiple time on an
NSConnection object.
This is the behaviour on Mac.
Actual Behaviour.
Initial calls to rootProxy, and subsequent calls in the same method succeed.
Once the method that first called rootProxy is exited subsequently sending
rootProxy to the NSConnection instance (e.g. if its stored in an array and
retrieved later) cause NSConnectionDidDieNotifications to be posted and
exceptions to be raised.
The exceptions are different for message ports and socket ports.
Message ports raise NSPortTimeoutExceptions with reason 'root proxy request -
port was invalidated'
Socket ports raise NSObjectInaccessibleException with reason 'Waiting for
reply in wrong thread'
The bug is also present in gnustep-base-1.16
Reason
It seems that NSConnection tries to reuse the NSDistantObject created on the
first call to rootProxy but does not retain it. Thus after exiting the method
where the root proxy is first obtained it may be released.
Workaround
Retaining the rootProxy when its first returned avoids the bug. However doing
this is difficult unless a central class manages all connections.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?27128>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnustep