From c4c9fe609796d1e3848cd65df30c942dbd612f3b Mon Sep 17 00:00:00 2001 From: gcasa Date: Fri, 5 Jun 2009 22:16:07 +0000 Subject: [PATCH] Incorporated patch by David Chisnall. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28326 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSDistantObject.m | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1a5aaf86c..8f4847e0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-05 18:12-EDT Gregory John Casamento + + * Source/NSDistantObject.m: NSProxy subclasses must override -init + or an exception will be thrown. This change calls the forwarding + mechanism to invoke -init on the remote object. + Patch by David Chisnall + 2009-06-04 Georg Fleischmann * Source/Additions/unicode/nextstep.h: Fixups for encoding mapping. diff --git a/Source/NSDistantObject.m b/Source/NSDistantObject.m index 434b90db8..4fba48581 100644 --- a/Source/NSDistantObject.m +++ b/Source/NSDistantObject.m @@ -443,6 +443,21 @@ enum proxyLocation { return _connection; } +/** + * NSProxy subclasses must override -init or an exception will be thrown. This + * calls the forwarding mechanism to invoke -init on the remote object. + */ +- (id)init +{ + NSMethodSignature *sig = [self methodSignatureForSelector: _cmd]; + NSInvocation *inv = [NSInvocation invocationWithMethodSignature: sig]; + id ret; + [inv setTarget: self]; + [inv setSelector: _cmd]; + [self forwardInvocation: inv]; + [inv getReturnValue: &ret]; + return ret; +} - (void) dealloc {