Windows: Wait for WM_NCDESTROY before calling OnBeforeClose (issue #2248)
This commit is contained in:
parent
2c22842b7e
commit
3d5ae838ca
|
@ -594,7 +594,7 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
|
||||||
// Allow the close.
|
// Allow the close.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_NCDESTROY:
|
||||||
if (platform_delegate) {
|
if (platform_delegate) {
|
||||||
// Clear the user data pointer.
|
// Clear the user data pointer.
|
||||||
gfx::SetWindowUserData(hwnd, NULL);
|
gfx::SetWindowUserData(hwnd, NULL);
|
||||||
|
@ -604,7 +604,7 @@ LRESULT CALLBACK CefBrowserPlatformDelegateNativeWin::WndProc(HWND hwnd,
|
||||||
// CreateHostWindow().
|
// CreateHostWindow().
|
||||||
browser->WindowDestroyed();
|
browser->WindowDestroyed();
|
||||||
}
|
}
|
||||||
return 0;
|
break;
|
||||||
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
if (platform_delegate && platform_delegate->window_widget_) {
|
if (platform_delegate && platform_delegate->window_widget_) {
|
||||||
|
|
|
@ -140,7 +140,7 @@ MainMessageLoopMultithreadedWin::MessageWndProc(HWND hWnd,
|
||||||
task->Release();
|
task->Release();
|
||||||
} else {
|
} else {
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case WM_DESTROY:
|
case WM_NCDESTROY:
|
||||||
// Clear the reference to |self|.
|
// Clear the reference to |self|.
|
||||||
SetUserDataPtr(hWnd, NULL);
|
SetUserDataPtr(hWnd, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -614,7 +614,7 @@ LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd,
|
||||||
SetUserDataPtr(hWnd, NULL);
|
SetUserDataPtr(hWnd, NULL);
|
||||||
self->hwnd_ = NULL;
|
self->hwnd_ = NULL;
|
||||||
self->OnDestroyed();
|
self->OnDestroyed();
|
||||||
return 0;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||||
|
|
Loading…
Reference in New Issue