mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
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:
+1
-2
@@ -558,8 +558,7 @@ func (w *window) runLoop() {
|
|||||||
msg := new(windows.Msg)
|
msg := new(windows.Msg)
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
anim := w.animating
|
if w.hwnd != 0 && w.animating && !windows.PeekMessage(msg, 0, 0, 0, windows.PM_NOREMOVE) {
|
||||||
if anim && !windows.PeekMessage(msg, 0, 0, 0, windows.PM_NOREMOVE) {
|
|
||||||
w.draw(false)
|
w.draw(false)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user