mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
app: [windows] ensure no callbacks after DestroyEvent
Setting the callback handler to nil in DestroyEvent should have no effect, but may help debugging #603. Also don't call the default window handler for WM_DESTROY since we're already handling it. References: https://todo.sr.ht/~eliasnaur/gio/603 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -314,6 +314,7 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
|
|||||||
case windows.WM_DESTROY:
|
case windows.WM_DESTROY:
|
||||||
w.ProcessEvent(Win32ViewEvent{})
|
w.ProcessEvent(Win32ViewEvent{})
|
||||||
w.ProcessEvent(DestroyEvent{})
|
w.ProcessEvent(DestroyEvent{})
|
||||||
|
w.w = nil
|
||||||
if w.hdc != 0 {
|
if w.hdc != 0 {
|
||||||
windows.ReleaseDC(w.hdc)
|
windows.ReleaseDC(w.hdc)
|
||||||
w.hdc = 0
|
w.hdc = 0
|
||||||
@@ -321,6 +322,7 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
|
|||||||
// The system destroys the HWND for us.
|
// The system destroys the HWND for us.
|
||||||
w.hwnd = 0
|
w.hwnd = 0
|
||||||
windows.PostQuitMessage(0)
|
windows.PostQuitMessage(0)
|
||||||
|
return 0
|
||||||
case windows.WM_NCCALCSIZE:
|
case windows.WM_NCCALCSIZE:
|
||||||
if w.config.Decorated {
|
if w.config.Decorated {
|
||||||
// Let Windows handle decorations.
|
// Let Windows handle decorations.
|
||||||
|
|||||||
Reference in New Issue
Block a user