From 7ac946abe5c2955b7c92ea9a8381fece12aaa71a Mon Sep 17 00:00:00 2001 From: CaS Date: Fri, 21 Sep 2001 15:51:24 +0000 Subject: [PATCH] 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 --- ChangeLog | 7 +++---- Source/NSConnection.m | 11 +++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 054a32811..c64e4f692 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2001-09-20 Richard Frith-Macdonald +2001-09-21 Richard Frith-Macdonald * 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 diff --git a/Source/NSConnection.m b/Source/NSConnection.m index 7276ed025..a73c62248 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -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]; } }