From 18a3ed0332a4f466ac5c4873e17cd94abdff27f7 Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 15 Apr 2010 16:27:23 +0000 Subject: [PATCH] Attempt leak fix git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30168 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSConnection.m | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index b12dc8998..e1131c862 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-04-15 Richard Frith-Macdonald + + * Source/NSConnection.m: when decoding a pointer to an object, autorelease + the object to avoid a leak. + 2010-04-14 Richard Frith-Macdonald * Source/ObjectiveC2/runtime.c: work around buggy objc_skip_argspec() diff --git a/Source/NSConnection.m b/Source/NSConnection.m index 5b0e07be0..1b8c9ac68 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -2178,6 +2178,10 @@ static NSLock *cached_proxies_gate = nil; tmptype++; [inv getArgument: &datum atIndex: argnum]; [aRmc decodeValueOfObjCType: tmptype at: datum]; + if (*tmptype == _C_ID) + { + [*(id*)datum autorelease]; + } } else if (*tmptype == _C_CHARPTR && ((flags & _F_OUT) || !(flags & _F_IN)))