Fixed all (I think) memory leaks in DO with exceptions using FFCALL

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10946 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2001-09-21 15:51:24 +00:00
parent 93b4c211f7
commit 7ac946abe5
2 changed files with 6 additions and 12 deletions

View file

@ -1,4 +1,4 @@
2001-09-20 Richard Frith-Macdonald <rfm@gnu.org> 2001-09-21 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/gnustep/base/DistributedObjects.h: * Headers/gnustep/base/DistributedObjects.h:
* Source/GSFFCallInvocation.m: * Source/GSFFCallInvocation.m:
@ -8,9 +8,8 @@
* Source/callframe.m: * Source/callframe.m:
Modifications to callframe handling to store pointers to data to Modifications to callframe handling to store pointers to data to
be freed in order to be able to tidy up after an exception ... be freed in order to be able to tidy up after an exception ...
Appears to cure memory leak in ffcall code on server side. Appears to cure memory leak in ffcall code.
No fix yest for mframe or ffi code, or for client side leak No fix yest for mframe or ffi code.
when an exception occurs in the server.
2001-09-20 Richard Frith-Macdonald <rfm@gnu.org> 2001-09-20 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -1537,20 +1537,15 @@ static void retDecoder(DOContext *ctxt)
if (is_exception == YES) if (is_exception == YES)
{ {
/* Decode the exception object, and raise it. */ /* Decode the exception object, and raise it. */
id exc; id exc = [coder decodeObject];
[coder decodeValueOfObjCType: @encode(id) at: &exc];
ctxt->decoder = nil; ctxt->decoder = nil;
[ctxt->connection _doneInRmc: coder]; [ctxt->connection _doneInReply: coder];
if (ctxt->datToFree != 0) if (ctxt->datToFree != 0)
{ {
NSZoneFree(NSDefaultMallocZone(), ctxt->datToFree); NSZoneFree(NSDefaultMallocZone(), ctxt->datToFree);
ctxt->datToFree = 0; ctxt->datToFree = 0;
} }
if (ctxt->objToFree != nil)
{
NSDeallocateObject(ctxt->objToFree);
ctxt->objToFree = nil;
}
[exc raise]; [exc raise];
} }
} }