Fix crash in wxMSW wxProgressDialog without wxPD_APP_MODAL style.

Use the correct method to retrieve the parent window to disable and check that
this pointer is not NULL before dereferencing it.

Closes #12414.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-09-04 13:33:36 +00:00
parent aebe0d3b6c
commit a5655d37db

View File

@@ -628,7 +628,18 @@ bool wxProgressDialog::Show(bool show)
}
if ( !HasFlag(wxPD_APP_MODAL) )
GetParent()->Disable();
{
wxWindow * const parent = GetTopParent();
if ( parent )
{
parent->Disable();
}
else
{
wxFAIL_MSG( "Progress dialog must have a valid parent if "
"wxPD_APP_MODAL is not used." );
}
}
//else: otherwise all windows will be disabled by m_taskDialogRunner
// Do not show the underlying dialog.