private void Dispose(bool manuallyCalled) { if (!IsDisposed) { if (manuallyCalled) { IntPtr display = Display; if (IsCurrent) { using (new XLock(display)) { Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero); } } using (new XLock(display)) { Glx.DestroyContext(display, Handle); } } } else { Debug.Print("[Warning] {0} leaked.", this.GetType().Name); } IsDisposed = true; }
private void Dispose(bool manuallyCalled) { if (!this.IsDisposed && manuallyCalled) { IntPtr display = this.Display; if (this.IsCurrent) { using (new XLock(display)) Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero); } using (new XLock(display)) Glx.DestroyContext(display, this.Handle); } this.IsDisposed = true; }
private void Dispose(bool manuallyCalled) { if (!IsDisposed) { if (manuallyCalled) { if (GraphicsContext.CurrentContext != null && ((IGraphicsContextInternal)GraphicsContext.CurrentContext).Context == Handle) { GraphicsContext.CurrentContext.MakeCurrent(null); } Glx.DestroyContext(currentWindow.Display, Handle); } else { Debug.Print("[Warning] {0} leaked.", this.GetType().Name); } IsDisposed = true; } }
public static void DestroyContext(IntPtr dpy, ContextHandle context) { Glx.DestroyContext(dpy, context.Handle); }