@@ -63,11 +63,12 @@ return self; } - (void)dealloc { - [self close]; + if (_stream != nil) + [self close]; [_inflateStream release]; [_modificationDate release]; [super dealloc]; @@ -321,11 +322,14 @@ return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer); } - (void)close { + if (_stream == nil) + @throw [OFNotOpenException exceptionWithObject: self]; + [_stream release]; _stream = nil; [super close]; } @end