app: [Windows] don't draw after WM_DESTROY destroyed the window

There may be a window of time from WM_DESTROY is received to the WM_QUIT
message is delivered by PostQuitMessage. If so, we must not call w.draw.

Fixes: https://todo.sr.ht/~eliasnaur/gio/603
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2024-07-30 13:49:31 +02:00
parent 6aa027136e
commit 042ed4ab49
+1 -2
View File
@@ -558,8 +558,7 @@ func (w *window) runLoop() {
msg := new(windows.Msg)
loop:
for {
anim := w.animating
if anim && !windows.PeekMessage(msg, 0, 0, 0, windows.PM_NOREMOVE) {
if w.hwnd != 0 && w.animating && !windows.PeekMessage(msg, 0, 0, 0, windows.PM_NOREMOVE) {
w.draw(false)
continue
}