@@ -13,16 +13,16 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFMemoryNotPartOfObjectException.h" #import "OFString.h" -#import "OFNotImplementedException.h" - @implementation OFMemoryNotPartOfObjectException + (instancetype)exceptionWithClass: (Class)class_ pointer: (void*)ptr { return [[[self alloc] initWithClass: class_ @@ -29,14 +29,17 @@ pointer: ptr] autorelease]; } - initWithClass: (Class)class_ { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithClass: (Class)class_ pointer: (void*)ptr {