X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c980c992630e94e71139660631a77ffbca8ed958..420ec58abbf042de49ccde2253abd96dbc85c8ff:/src/generic/progdlgg.cpp diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 542ffad161..fb07876a73 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -65,8 +65,11 @@ wxProgressDialog::wxProgressDialog(wxString const &title, m_maximum = maximum; m_elapsed = m_estimated = m_remaining = NULL; - if ((style & (wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME)) != 0) m_time = new wxTime; - else m_time = NULL; + if ((style & (wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | + wxPD_REMAINING_TIME)) != 0) + m_time = new wxTime; + else + m_time = NULL; wxFrame::Create(m_parent, -1, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE); @@ -198,7 +201,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 +290,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;