mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
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:
@@ -657,5 +657,4 @@ void
|
||||
GcWindow::_closeWindow()
|
||||
{
|
||||
emit closeWindow(this);
|
||||
QObject::deleteLater();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user