don't crash in dtor if the dialog had never been shown (patch 1723848) [backport from HEAD]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46184 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-05-23 23:40:12 +00:00
parent 4d5f003a08
commit 00f028e500

View File

@@ -381,9 +381,11 @@ wxFindReplaceDialog::wxFindReplaceDialog(wxWindow *parent,
wxFindReplaceDialog::~wxFindReplaceDialog() wxFindReplaceDialog::~wxFindReplaceDialog()
{ {
if ( m_impl )
{
// the dialog might have been already deleted if the user closed it // 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 // manually but in this case we should have got a notification about it
// the flagmust have been set // and the flag must have been set
if ( !m_impl->WasClosedByUser() ) if ( !m_impl->WasClosedByUser() )
{ {
// if it wasn't, delete the dialog ourselves // if it wasn't, delete the dialog ourselves
@@ -395,6 +397,7 @@ wxFindReplaceDialog::~wxFindReplaceDialog()
// unsubclass the parent // unsubclass the parent
delete m_impl; delete m_impl;
}
// prevent the base class dtor from trying to hide us! // prevent the base class dtor from trying to hide us!
m_isShown = false; m_isShown = false;