public void Dispose() { if (this.archiveHandle != IntPtr.Zero) { Unrar32.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 = Unrar32.RARCloseArchive(this.archiveHandle); // Check result if (result != 0) { ProcessFileError(result); } else { this.archiveHandle = IntPtr.Zero; } }