protected override void Dispose(bool disposing) { if (_disposed) { return; } if (OwnsResource()) { UnsafeNativeMethods.MpCalculatorGraphConfigDestroy(ptr); } ptr = IntPtr.Zero; _disposed = true; }