Fix SEGV on cancel remove chart

Recent update to use deleteLater() when removing
a chart in the event loop /always/ deletes the chart
regardless of the user selection, this is because it
is deleted in the wrong place.

It was deleted when the user selected the close menu
option (in GoldenCheetah.cpp) rather than after the
user had confirmed (in HomeWindow.cpp).
This commit is contained in:
Mark Liversedge
2012-12-01 22:19:46 +00:00
parent b5300181ce
commit cd2145504a
2 changed files with 2 additions and 3 deletions

View File

@@ -657,5 +657,4 @@ void
GcWindow::_closeWindow()
{
emit closeWindow(this);
QObject::deleteLater();
}

View File

@@ -740,8 +740,8 @@ HomeWindow::removeChart(int num, bool confirm)
default:
break; // never reached
}
(GcWindow*)(charts[num])->close(); // disconnect
//(GcWindow*)(charts[num])->deleteLater();
((GcWindow*)(charts[num]))->close(); // disconnect
((GcWindow*)(charts[num]))->deleteLater();
charts.removeAt(num);
update();