Fix parent/child relationship in MSW wxFindReplaceDialog

It's not enough to set the parent pointer in the child, the parent also
needs to be aware of its child, so call AddChild() to do both at once.

This ensures that find dialog with non-null parent is destroyed by it
when it is itself destroyed.

Closes #18747.
This commit is contained in:
Vadim Zeitlin 2020-05-03 20:17:31 +02:00
parent 35f1cb417b
commit 05bf67df1e

View File

@ -347,7 +347,9 @@ bool wxFindReplaceDialog::Create(wxWindow *parent,
{
m_windowStyle = flags;
m_FindReplaceData = data;
m_parent = parent;
if ( parent )
parent->AddChild(this);
SetTitle(title);