From f5bb569071b945e8d4ff2d4b9eed6e1a98bef739 Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 14 Mar 2007 08:57:20 +0000 Subject: [PATCH] Fix memory leak git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24868 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/Additions/GSXML.m | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ecb17a54b..66e0e7248 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-14 Richard Frith-Macdonald + + * Source/Additions/GSXML.m: Fix memory leak caused by url handle + retaining xmlrpc object as a client. + 2007-03-13 Richard Frith-Macdonald * Source/GSLocale.m: Expect locale information (nl_langinfo) to be in diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index 709ea85c5..ed02b0180 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -5076,7 +5076,6 @@ static void indentation(unsigned level, NSMutableString *str) [handle writeProperty: pKey forKey: GSHTTPPropertyKeyFileKey]; [handle writeProperty: pwd forKey: GSHTTPPropertyPasswordKey]; } - [handle addClient: self]; #else connectionURL = [url copy]; connection = nil; @@ -5310,6 +5309,7 @@ static void indentation(unsigned level, NSMutableString *str) repeats: NO]; #ifdef GNUSTEP + [handle addClient: self]; [handle writeProperty: @"POST" forKey: GSHTTPPropertyMethodKey]; [handle writeProperty: @"GSXMLRPC/1.0.0" forKey: @"User-Agent"]; [handle writeProperty: @"text/xml" forKey: @"Content-Type"]; @@ -5394,6 +5394,9 @@ static void indentation(unsigned level, NSMutableString *str) ASSIGN(result, reason); [timer invalidate]; timer = nil; +#ifdef GNUSTEP + [handle removeClient: self]; +#endif if ([delegate respondsToSelector: @selector(completedXMLRPC:)]) { [delegate completedXMLRPC: self]; @@ -5411,6 +5414,9 @@ static void indentation(unsigned level, NSMutableString *str) [timer invalidate]; timer = nil; +#ifdef GNUSTEP + [handle removeClient: self]; +#endif str = [handle propertyForKeyIfAvailable: NSHTTPPropertyStatusCodeKey]; if (str == nil) { @@ -5464,6 +5470,9 @@ static void indentation(unsigned level, NSMutableString *str) [timer invalidate]; timer = nil; +#ifdef GNUSTEP + [handle removeClient: self]; +#endif if ([delegate respondsToSelector: @selector(completedXMLRPC:)]) {