public void Dispose() { if (this.archiveHandle != IntPtr.Zero) { Unrar.RARCloseArchive(this.archiveHandle); this.archiveHandle = IntPtr.Zero; } }
/// <summary> /// Close the currently open archive /// </summary> /// <returns></returns> public void Close() { // Exit without exception if no archive is open if (this.archiveHandle == IntPtr.Zero) { return; } // Close archive int result = Unrar.RARCloseArchive(this.archiveHandle); // Check result if (result != 0) { ProcessFileError(result); } else { this.archiveHandle = IntPtr.Zero; } }