X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..f3f0d961af5454a3544a4f4f9aced750d4641d69:/src/msw/mdi.cpp?ds=sidebyside diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 2a7c8f717a..edb246d750 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -233,12 +233,12 @@ bool wxMDIParentFrame::Create(wxWindow *parent, wxMDIParentFrame::~wxMDIParentFrame() { - DestroyChildren(); - - // already delete by DestroyChildren() + // see comment in ~wxMDIChildFrame m_frameToolBar = NULL; m_frameStatusBar = NULL; + DestroyChildren(); + if (m_windowMenu) { delete m_windowMenu; @@ -671,9 +671,9 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, MDICREATESTRUCT mcs; - mcs.szClass = style & wxNO_FULL_REPAINT_ON_RESIZE - ? wxMDIChildFrameClassNameNoRedraw - : wxMDIChildFrameClassName; + mcs.szClass = style & wxFULL_REPAINT_ON_RESIZE + ? wxMDIChildFrameClassName + : wxMDIChildFrameClassNameNoRedraw; mcs.szTitle = title; mcs.hOwner = wxGetInstance(); if (x > -1) @@ -696,7 +696,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, else mcs.cy = CW_USEDEFAULT; - DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_THICKFRAME | WS_VISIBLE ; + DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_VISIBLE ; if (style & wxMINIMIZE_BOX) msflags |= WS_MINIMIZEBOX; if (style & wxMAXIMIZE_BOX) @@ -730,12 +730,13 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, wxMDIChildFrame::~wxMDIChildFrame() { - DestroyChildren(); - - // already deleted by DestroyChildren() + // will be destroyed by DestroyChildren() but reset them before calling it + // to avoid using dangling pointers if a callback comes in the meanwhile m_frameToolBar = NULL; m_frameStatusBar = NULL; + DestroyChildren(); + RemoveWindowMenu(NULL, m_hMenu); MSWDestroyWindow(); @@ -1064,7 +1065,7 @@ bool wxMDIChildFrame::HandleGetMinMaxInfo(void *mmInfo) processed = true; } - return true; + return processed; } // ---------------------------------------------------------------------------