@@ -339,10 +339,11 @@ - (instancetype)initWithHandle: (OFFileHandle)handle { self = [super init]; _handle = handle; + _initialized = true; return self; } - (instancetype)init @@ -554,11 +555,11 @@ [super close]; } - (void)dealloc { - if (_handle != OFInvalidFileHandle) + if (_initialized && _handle != OFInvalidFileHandle) [self close]; [super dealloc]; } @end