attempt memory leak fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29993 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-03-17 11:28:04 +00:00
parent 66749afa77
commit 20864d7e59
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,13 @@
2010-03-17 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSConnection.m: Fix for memory leak ... autorelease
objects returned by method in remote process because the invocation
won't do it for us (we call -setReturnValue: which will have the invocation
retain the object, so when it releases it again later the retain count is
the same as at the point when we decoded the object, and another release
is needed).
I'm not certain this fix is right, but it seems ok.
2010-03-13 Yavor Doganov <yavor@gnu.org> (tiny change) 2010-03-13 Yavor Doganov <yavor@gnu.org> (tiny change)
* Source/NSCalendarDate.m (outputValueWithFormat) * Source/NSCalendarDate.m (outputValueWithFormat)

View file

@ -2105,11 +2105,18 @@ static NSLock *cached_proxies_gate = nil;
/* xxx What happens with method declared "- (in char *) bar;" */ /* xxx What happens with method declared "- (in char *) bar;" */
/* xxx Is this right? Do we also have to check _F_ONEWAY? */ /* xxx Is this right? Do we also have to check _F_ONEWAY? */
{ {
id obj;
/* If there is a return value, decode it, and put it in datum. */ /* If there is a return value, decode it, and put it in datum. */
if (*tmptype != _C_VOID || (flags & _F_ONEWAY) == 0) if (*tmptype != _C_VOID || (flags & _F_ONEWAY) == 0)
{ {
switch (*tmptype) switch (*tmptype)
{ {
case _C_ID:
datum = &obj;
[aRmc decodeValueOfObjCType: tmptype at: datum];
[obj autorelease];
break;
case _C_PTR: case _C_PTR:
/* We are returning a pointer to something. */ /* We are returning a pointer to something. */
tmptype++; tmptype++;
@ -2151,7 +2158,7 @@ static NSLock *cached_proxies_gate = nil;
if (*tmptype == _C_PTR if (*tmptype == _C_PTR
&& ((flags & _F_OUT) || !(flags & _F_IN))) && ((flags & _F_OUT) || !(flags & _F_IN)))
{ {
/* If the arg was myref, we obtain its address /* If the arg was byref, we obtain its address
* and decode the data directly to it. * and decode the data directly to it.
*/ */
tmptype++; tmptype++;