Use Destroy() rather than delete for dialogs in the sample

Even though it doesn't make any real difference for these dialogs, we
still shouldn't delete top level windows directly and should rather call
Destroy() on them to let them be cleaned up during the next idle time
processing.

See #18747.
This commit is contained in:
Vadim Zeitlin 2020-05-03 20:21:23 +02:00
parent 05bf67df1e
commit 7158c9b5be

View File

@ -3038,7 +3038,9 @@ void MyFrame::ShowReplaceDialog( wxCommandEvent& WXUNUSED(event) )
{ {
if ( m_dlgReplace ) if ( m_dlgReplace )
{ {
wxDELETE(m_dlgReplace); m_dlgReplace->Destroy();
m_dlgReplace = NULL;
} }
else else
{ {
@ -3058,7 +3060,9 @@ void MyFrame::ShowFindDialog( wxCommandEvent& WXUNUSED(event) )
{ {
if ( m_dlgFind ) if ( m_dlgFind )
{ {
wxDELETE(m_dlgFind); m_dlgFind->Destroy();
m_dlgFind = NULL;
} }
else else
{ {