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

Updates #2551
This commit is contained in:
Hajime Hoshi 2023-04-18 23:53:23 +09:00
parent 65afb51d73
commit 6817be2594

View File

@ -309,7 +309,9 @@ func platformTerminate() error {
if _glfw.platformWindow.helperWindowHandle != 0 {
if !microsoftgdk.IsXbox() {
if err := _DestroyWindow(_glfw.platformWindow.helperWindowHandle); 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(_glfw.platformWindow.helperWindowHandle); err != nil && !errors.Is(err, windows.ERROR_INVALID_WINDOW_HANDLE) {
return err
}
}