/// <summary> /// Closes the Zip file and releases the unmanaged resources /// </summary> private void CloseFile() { if (_zipFileHandle == IntPtr.Zero) { return; } try { CloseCurrentEntry(); } finally { int result = ZlibWrapper.ZlibUnzClose(_zipFileHandle); if (result < 0) { throw new ZipException("Could not close zip file.", result); } _zipFileHandle = IntPtr.Zero; } }