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:
Richard Frith-Macdonald 2001-09-21 15:51:24 +00:00
parent 7596e3cfba
commit f8cf838ad5
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:
* Source/GSFFCallInvocation.m:
@ -8,9 +8,8 @@
* Source/callframe.m:
Modifications to callframe handling to store pointers to data to
be freed in order to be able to tidy up after an exception ...
Appears to cure memory leak in ffcall code on server side.
No fix yest for mframe or ffi code, or for client side leak
when an exception occurs in the server.
Appears to cure memory leak in ffcall code.
No fix yest for mframe or ffi code.
2001-09-20 Richard Frith-Macdonald <rfm@gnu.org>

View file

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