Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -39,11 +39,12 @@ @end /** * The OFException class is the base class for all exceptions in ObjFW. * - * IMPORTANT: Exceptions do NOT use OFAutoreleasePools!! + * IMPORTANT: Exceptions do NOT use OFAutoreleasePools and can't be autoreleased + * either! You have to make sure to dealloc the exception in your @catch block! */ @interface OFException: OFObject { Class class_; OFString *string; Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -102,10 +102,16 @@ - (OFString*)string { return string; } + +- autorelease +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} @end @implementation OFOutOfMemoryException + newWithClass: (Class)class__ size: (size_t)size