diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 874d23d937..7245f39a0f 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -778,6 +778,10 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, wxMDIChildFrame::~wxMDIChildFrame() { + // if we hadn't been created, there is nothing to destroy + if ( !m_hWnd ) + return; + // will be destroyed by DestroyChildren() but reset them before calling it // to avoid using dangling pointers if a callback comes in the meanwhile #if wxUSE_TOOLBAR