From 61bc272015063e22ddac7d25b8d66862344d5a61 Mon Sep 17 00:00:00 2001 From: ayers Date: Thu, 16 Sep 2004 15:43:40 +0000 Subject: [PATCH] * Source/Additions/GSObjCRuntime.m (GSAppendMethodToList): Copy type information for the NeXT runtime. (GSRemoveMethodFromList): Add comment about potential minor leak. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20074 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/Additions/GSObjCRuntime.m | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b0172f4c..b7ec2b55e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,10 @@ * Headers/Additions/GNUstepBase/GSObjCRuntime.h: Define encoding macros for the NeXT runtime. + + * Source/Additions/GSObjCRuntime.m + (GSAppendMethodToList): Copy type information for NeXT_RUNTIME. + (GSRemoveMethodFromList): Add comment about potential minor leak. 2004-09-14 Richard Frith-Macdonald diff --git a/Source/Additions/GSObjCRuntime.m b/Source/Additions/GSObjCRuntime.m index 860a52b11..7cb6fae85 100644 --- a/Source/Additions/GSObjCRuntime.m +++ b/Source/Additions/GSObjCRuntime.m @@ -878,7 +878,7 @@ GSAppendMethodToList (GSMethodList list, #endif list->method_list[num].method_name = sel; - list->method_list[num].method_types = types; + list->method_list[num].method_types = strdup(types); list->method_list[num].method_imp = imp; } @@ -921,6 +921,9 @@ GSRemoveMethodFromList (GSMethodList list, } /* Clear the last entry. */ + /* NB: For the NeXT_RUNTIME we may leak the types + if they were set by GSAppendMethodFromList. Yet + as we can not determine the origin, we shall leak. */ list->method_list[i].method_name = 0; list->method_list[i].method_types = 0; list->method_list[i].method_imp = 0;