X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dfba244cbf2d6bef4c81a969d0bc72f824842e29..98225d0279de4d074d306b40683667670333be51:/src/msw/nativewin.cpp diff --git a/src/msw/nativewin.cpp b/src/msw/nativewin.cpp index 1f0ddeca87..6b3649b842 100644 --- a/src/msw/nativewin.cpp +++ b/src/msw/nativewin.cpp @@ -54,6 +54,27 @@ bool wxNativeContainerWindow::Create(wxNativeContainerWindowHandle hwnd) return true; } +void wxNativeContainerWindow::OnNativeDestroyed() +{ + // don't use Close() or even Destroy() here, we really don't want to keep + // an object using a no more existing HWND around for longer than necessary + delete this; +} + +WXLRESULT wxNativeContainerWindow::MSWWindowProc(WXUINT nMsg, + WXWPARAM wParam, + WXLPARAM lParam) +{ + if ( nMsg == WM_DESTROY ) + { + OnNativeDestroyed(); + + return 0; + } + + return wxTopLevelWindow::MSWWindowProc(nMsg, wParam, lParam); +} + wxNativeContainerWindow::~wxNativeContainerWindow() { // prevent the base class dtor from destroying the window, it doesn't