protected void Dispose(bool isDisposingManually) { if (isDisposed) { return; } if (handle != IntPtr.Zero) { Out123NativeMethods.Del(handle); handle = IntPtr.Zero; } if (isDisposingManually) { // cleanup dependancies } isDisposed = true; }