Dispose() public method

Disposes of this X11WindowInfo instance.
public Dispose ( ) : void
return void
        private void Dispose(bool manuallyCalled)
        {
            if (disposed)
            {
                return;
            }
            if (manuallyCalled)
            {
                if (window != null && window.WindowHandle != IntPtr.Zero)
                {
                    if (Exists)
                    {
                        API.XDestroyWindow(window.Display, window.WindowHandle);

                        while (Exists)
                        {
                            ProcessEvents();
                        }
                    }
                    window.Dispose();
                    window = null;
                }
            }
            else
            {
                Debug.Print("[Warning] {0} leaked.", this.GetType().Name);
            }
            disposed = true;
        }