protected override void Dispose(bool disposing) { if (_disposed) { return; } if (OwnsResource()) { UnsafeNativeMethods.MpGlTextureBufferDestroy(ptr); } if (deletionCallbackHandle != null && deletionCallbackHandle.IsAllocated) { deletionCallbackHandle.Free(); } ptr = IntPtr.Zero; _disposed = true; }