Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -153,10 +153,15 @@ @synchronized (tlskeys) { @try { listobj = [tlskeys append: self]; } @catch (OFException *e) { + /* + * We can't use [super dealloc] on OS X here. + * Compiler bug? Anyway, [self dealloc] will do here + * as we check listobj != NULL in dealloc. + */ listobj = NULL; [self dealloc]; @throw e; } } @@ -179,11 +184,13 @@ destructor(self); of_tlskey_free(key); @synchronized (tlskeys) { - [tlskeys remove: listobj]; + /* In case we called [self dealloc] in init */ + if (listobj != NULL) + [tlskeys remove: listobj]; } [super dealloc]; } @end