Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -13,10 +13,12 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME) # import #elif defined(OF_OLD_GNU_RUNTIME) # import @@ -114,21 +116,31 @@ classMethods = [[OFMutableArray alloc] init]; instanceMethods = [[OFMutableArray alloc] init]; methodList = class_copyMethodList(((OFObject*)class)->isa, &count); - for (i = 0; i < count; i++) { - [classMethods addObject: [[[OFMethod alloc] - _initWithMethod: methodList[i]] autorelease]]; - [pool releaseObjects]; + @try { + for (i = 0; i < count; i++) { + [classMethods addObject: [[[OFMethod alloc] + _initWithMethod: methodList[i]] + autorelease]]; + [pool releaseObjects]; + } + } @finally { + free(methodList); } methodList = class_copyMethodList(class, &count); - for (i = 0; i < count; i++) { - [instanceMethods addObject: [[[OFMethod alloc] - _initWithMethod: methodList[i]] autorelease]]; - [pool releaseObjects]; + @try { + for (i = 0; i < count; i++) { + [instanceMethods addObject: [[[OFMethod alloc] + _initWithMethod: methodList[i]] + autorelease]]; + [pool releaseObjects]; + } + } @finally { + free(methodList); } #elif defined(OF_OLD_GNU_RUNTIME) MethodList_t methodList; classMethods = [[OFMutableArray alloc] init];