/// <summary> /// Disposes object /// </summary> /// <param name="disposing">Flag indicating whether managed resources should be disposed</param> protected virtual void Dispose(bool disposing) { if (!this._disposed) { if (disposing) { // Dispose managed objects if (_p11 != null) { _p11.C_Finalize(IntPtr.Zero); _p11.Dispose(); _p11 = null; } } // Dispose unmanaged objects _disposed = true; } }
/// <summary> /// Disposes object /// </summary> /// <param name="disposing">Flag indicating whether managed resources should be disposed</param> protected virtual void Dispose(bool disposing) { _logger.Debug("Pkcs11({0})::Dispose2", _libraryPath); if (!this._disposed) { if (disposing) { // Dispose managed objects if (_p11 != null) { _p11.C_Finalize(IntPtr.Zero); _logger.Info("Unloading PKCS#11 library {0}", _libraryPath); _p11.Dispose(); _p11 = null; } } // Dispose unmanaged objects _disposed = true; } }