protected override bool ReleaseHandle()
{
switch (InitializationState)
{
case State.NotInitialized: return true;
case State.InitializedForDeflate: return (DeflateEnd() == ZLibNative.ErrorCode.Ok);
case State.InitializedForInflate: return (InflateEnd() == ZLibNative.ErrorCode.Ok);
case State.Disposed: return true;
default: return false; // This should never happen. Did we forget one of the State enum values in the switch?
}
}