mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
Code Cleanup: GcCalendarModel
.. wow, nasty memory leak fixed. Leaked memory every time a ride was selected or calendar was refreshed! .. tbf it was marked with a 'XXX' memory leak comment but really lazy to leave it there. .. was also highlighted by valgrind, which is promising, since I've been using it to hunt down any memory managment issues -- most of them are within 3rd party libraries tho.
This commit is contained in:
@@ -101,7 +101,15 @@ public slots:
|
||||
|
||||
// we need to build a list of all the rides
|
||||
// in the source model for the dates we have
|
||||
dateToRows.clear(); //XXX mem leak, need to delete vectors...
|
||||
// first we clear previous
|
||||
QMapIterator<QDate, QVector<int>* > fm(dateToRows);
|
||||
while (fm.hasNext()) {
|
||||
fm.next();
|
||||
delete fm.value();
|
||||
}
|
||||
dateToRows.clear();
|
||||
|
||||
// then we create new
|
||||
for (int j=0; j<sourceModel()->rowCount(); j++) {
|
||||
QVector<int> *arr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user