forked from joejulian/gio
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)
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user