Skip to content

Commit

Permalink
Merge pull request #7680 from Montellese/fix_progressjob
Browse files Browse the repository at this point in the history
CProgressJob: fix crash in DoModal after 658b0a2
  • Loading branch information
Montellese committed Aug 1, 2015
2 parents 7137081 + a3ca361 commit c5f806e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions xbmc/utils/ProgressJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ bool CProgressJob::DoModal()
// do the work
bool result = DoWork();

// close the progress dialog
if (m_autoClose)
m_progressDialog->Close();
// mark the progress dialog as finished (will close it)
MarkFinished();
m_modal = false;

return result;
Expand Down Expand Up @@ -182,18 +181,13 @@ void CProgressJob::MarkFinished()
if (m_updateProgress)
{
m_progress->MarkFinished();
//We don't own this pointer and it will be deleted after it's marked finished
//just set it to nullptr so we don't try to use it again
// We don't own this pointer and it will be deleted after it's marked finished
// just set it to nullptr so we don't try to use it again
m_progress = nullptr;
}
}
else if (m_progressDialog != NULL && m_autoClose)
{
m_progressDialog->Close();
//We don't own this pointer and it will be deleted after it's marked finished
//just set it to nullptr so we don't try to use it again
m_progressDialog = nullptr;
}
}

bool CProgressJob::IsCancelled() const
Expand Down

0 comments on commit c5f806e

Please sign in to comment.