Guard against segfaults due to out-of-order dialog deletion
This commit is contained in:
@@ -775,6 +775,11 @@ void TaskView::removeTaskWatcher(void)
|
||||
|
||||
void TaskView::accept()
|
||||
{
|
||||
if (!ActiveDialog) { // Protect against segfaults due to out-of-order deletions
|
||||
Base::Console().Warning("ActiveDialog was null in call to TaskView::accept()\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure that if 'accept' calls 'closeDialog' the deletion is postponed until
|
||||
// the dialog leaves the 'accept' method
|
||||
ActiveDialog->setProperty("taskview_accept_or_reject", true);
|
||||
@@ -786,6 +791,11 @@ void TaskView::accept()
|
||||
|
||||
void TaskView::reject()
|
||||
{
|
||||
if (!ActiveDialog) { // Protect against segfaults due to out-of-order deletions
|
||||
Base::Console().Warning("ActiveDialog was null in call to TaskView::reject()\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure that if 'reject' calls 'closeDialog' the deletion is postponed until
|
||||
// the dialog leaves the 'reject' method
|
||||
ActiveDialog->setProperty("taskview_accept_or_reject", true);
|
||||
|
||||
Reference in New Issue
Block a user