@@ -46,26 +46,20 @@ } + setObject: (id)obj forTLSKey: (OFTLSKey*)key { - id old; - - @try { - old = [self objectForTLSKey: key]; - } @catch (OFNotInSetException *e) { - [e dealloc]; - old = nil; - } + id old = [self objectForTLSKey: key]; #ifndef _WIN32 if (pthread_setspecific(key->key, obj)) #else if (!TlsSetValue(key->key, obj)) #endif /* FIXME: Maybe another exception would be better */ - @throw [OFNotInSetException newWithClass: self]; + @throw [OFInvalidArgumentException newWithClass: self + andSelector: _cmd]; if (obj != nil) [obj retain]; if (old != nil) [old release]; @@ -86,12 +80,12 @@ /* * NULL and nil might be different on some platforms. NULL is returned * if the key is missing, nil can be returned if it was explicitly set * to nil to release the old object. */ - if (ret == NULL || (id)ret == nil) - @throw [OFNotInSetException newWithClass: self]; + if (ret == NULL) + return nil; return (id)ret; } - initWithObject: (id)obj