mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
Fix First Ride File Import Crashes
When you import the very first ride into V3 it will cause a SEGV crash when attempting to freeMemory. This is because the first entry added to a list does not cause any selection to be made. This means that the very first time someone tries to use GC version 3 it will crash! Not the best of starts. This bug was previously reported as being related to importing json ride files, it occurs for ANY ride file type. Fixes #328.
This commit is contained in:
@@ -907,6 +907,10 @@ MainWindow::addRide(QString name, bool /* bSelect =true*/)
|
||||
}
|
||||
rideAdded(last); // here so emitted BEFORE rideSelected is emitted!
|
||||
allRides->insertChild(index, last);
|
||||
|
||||
// if it is the very first ride, we need to select it
|
||||
// after we added it
|
||||
if (!index) treeWidget->setCurrentItem(last);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user