From de17e037eb95aa0f82713bc2da4d6016822f3033 Mon Sep 17 00:00:00 2001 From: rfm Date: Sun, 4 Oct 2009 10:05:14 +0000 Subject: [PATCH] fix leak git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28771 72102866-910b-0410-8b05-ffd578937521 --- Headers/Foundation/NSInvocation.h | 1 + Source/GSInvocation.h | 1 - Source/NSInvocation.m | 10 ++++------ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Headers/Foundation/NSInvocation.h b/Headers/Foundation/NSInvocation.h index c6fd20a56..d1bb61ceb 100644 --- a/Headers/Foundation/NSInvocation.h +++ b/Headers/Foundation/NSInvocation.h @@ -50,6 +50,7 @@ extern "C" { BOOL _targetRetained; BOOL _validReturn; BOOL _sendToSuper; + void *_retptr; } /* diff --git a/Source/GSInvocation.h b/Source/GSInvocation.h index e67041c7f..6419f4b12 100644 --- a/Source/GSInvocation.h +++ b/Source/GSInvocation.h @@ -30,7 +30,6 @@ @interface GSFFIInvocation : NSInvocation { uint8_t _retbuf[32]; // Store return values of up to 32 bytes here. - void *_retptr; // Store bigger return values in here. } @end diff --git a/Source/NSInvocation.m b/Source/NSInvocation.m index c0dcc91a6..8734f1095 100644 --- a/Source/NSInvocation.m +++ b/Source/NSInvocation.m @@ -329,18 +329,12 @@ _arg_addr(NSInvocation *inv, int index) if (_cframe) { NSZoneFree(NSDefaultMallocZone(), _cframe); - _retval = 0; // Part of _cframe } #elif defined(USE_FFCALL) if (_cframe) { NSZoneFree(NSDefaultMallocZone(), _cframe); } - if (_retptr) - { - NSZoneFree(NSDefaultMallocZone(), _retptr); - } - _retval = 0; #else if (_cframe) { @@ -351,6 +345,10 @@ _arg_addr(NSInvocation *inv, int index) NSZoneFree(NSDefaultMallocZone(), _retval); } #endif + if (_retptr) + { + NSZoneFree(NSDefaultMallocZone(), _retptr); + } RELEASE(_sig); [super dealloc]; }