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:
@@ -349,9 +349,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
|
||||||
@@ -363,6 +365,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;
|
||||||
|
Reference in New Issue
Block a user