diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 542ffad161..4f7d4b3802 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -198,7 +198,9 @@ wxProgressDialog::wxProgressDialog(wxString const &title, Centre(wxCENTER_FRAME | wxBOTH); if(m_disableParentOnly) - m_parent->Enable(FALSE); + { + if(m_parent) m_parent->Enable(FALSE); + } else wxEnableTopLevelWindows(FALSE); @@ -285,7 +287,9 @@ void wxProgressDialog::OnClose(wxCloseEvent& event) wxProgressDialog::~wxProgressDialog() { if ( m_disableParentOnly ) - m_parent->Enable(TRUE); + { + if(m_parent) m_parent->Enable(TRUE); + } else wxEnableTopLevelWindows(TRUE); if (m_time) delete m_time;