diff --git a/internal/goglfw/win32window_windows.go b/internal/goglfw/win32window_windows.go index 28fc47228..701797f55 100644 --- a/internal/goglfw/win32window_windows.go +++ b/internal/goglfw/win32window_windows.go @@ -1458,7 +1458,9 @@ func (w *Window) platformDestroyWindow() error { if w.platform.handle != 0 { if !microsoftgdk.IsXbox() { - if err := _DestroyWindow(w.platform.handle); err != nil { + // An error 'invalid window handle' can occur without any specific reasons (#2551). + // As there is nothing to do, just ignore this error. + if err := _DestroyWindow(w.platform.handle); err != nil && !errors.Is(err, windows.ERROR_INVALID_WINDOW_HANDLE) { return err } }