internal/goglfw: ignore invalid-window-handle error at DestroyWindow

Closes #2551
This commit is contained in:
Hajime Hoshi 2023-03-31 23:52:52 +09:00
parent 14b34a7b0a
commit f5e0496611

View File

@ -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
}
}