don't crash in dtor if the dialog had never been shown (patch 1723848)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e0b3b9d044
commit
86d870753c
@ -349,20 +349,23 @@ wxFindReplaceDialog::wxFindReplaceDialog(wxWindow *parent,
|
||||
|
||||
wxFindReplaceDialog::~wxFindReplaceDialog()
|
||||
{
|
||||
// the dialog might have been already deleted if the user closed it
|
||||
// manually but in this case we should have got a notification about it and
|
||||
// the flagmust have been set
|
||||
if ( !m_impl->WasClosedByUser() )
|
||||
if ( m_impl )
|
||||
{
|
||||
// if it wasn't, delete the dialog ourselves
|
||||
if ( !::DestroyWindow(GetHwnd()) )
|
||||
// the dialog might have been already deleted if the user closed it
|
||||
// manually but in this case we should have got a notification about it
|
||||
// and the flag must have been set
|
||||
if ( !m_impl->WasClosedByUser() )
|
||||
{
|
||||
wxLogLastError(_T("DestroyWindow(find dialog)"));
|
||||
// if it wasn't, delete the dialog ourselves
|
||||
if ( !::DestroyWindow(GetHwnd()) )
|
||||
{
|
||||
wxLogLastError(_T("DestroyWindow(find dialog)"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// unsubclass the parent
|
||||
delete m_impl;
|
||||
// unsubclass the parent
|
||||
delete m_impl;
|
||||
}
|
||||
|
||||
// prevent the base class dtor from trying to hide us!
|
||||
m_isShown = false;
|
||||
|
Loading…
Reference in New Issue
Block a user