Skip to content

Commit f5f3468

Browse files
unknownbradfitz
unknown
authored andcommitted
shiny/driver/internal/win32: send WM_CLOSE on Release
Calling DestroyWindow in Release is not allowed when running on a different thread than the message pump. This sends a WM_CLOSE message instead, that is handled by the message pump itself. Fixes golang/go#25671 Change-Id: Ie8610a8385faa2746dc7eabac11edc1106e8bb6e Reviewed-on: https://go-review.googlesource.com/115998 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent d20ef58 commit f5f3468

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

shiny/driver/internal/win32/win32.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,7 @@ func Show(hwnd syscall.Handle) {
116116
}
117117

118118
func Release(hwnd syscall.Handle) {
119-
// TODO(andlabs): check for errors from this?
120-
// TODO(andlabs): remove unsafe
121-
_DestroyWindow(hwnd)
122-
// TODO(andlabs): what happens if we're still painting?
119+
SendMessage(hwnd, _WM_CLOSE, 0, 0)
123120
}
124121

125122
func sendFocus(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) {

0 commit comments

Comments
 (0)