public void Dispose() { _framebuffer?.Dispose(); _framebuffer = null; if (_hwnd != IntPtr.Zero) { UnmanagedMethods.DestroyWindow(_hwnd); _hwnd = IntPtr.Zero; } if (_className != null) { UnmanagedMethods.UnregisterClass(_className, UnmanagedMethods.GetModuleHandle(null)); _className = null; } }
public void Dispose() { s_instances.Remove(this); _framebuffer.Dispose(); UnmanagedMethods.DestroyWindow(_hwnd); }