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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user