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:
@@ -3038,7 +3038,9 @@ void MyFrame::ShowReplaceDialog( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
if ( m_dlgReplace )
|
||||
{
|
||||
wxDELETE(m_dlgReplace);
|
||||
m_dlgReplace->Destroy();
|
||||
|
||||
m_dlgReplace = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3058,7 +3060,9 @@ void MyFrame::ShowFindDialog( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
if ( m_dlgFind )
|
||||
{
|
||||
wxDELETE(m_dlgFind);
|
||||
m_dlgFind->Destroy();
|
||||
|
||||
m_dlgFind = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user