Showing the changes to interface/src/UserLocationsModel.cpp (1 of 3 files). Show all
Unified · Split
| @@ -133,6 +133,11 @@ UserLocationsModel::UserLocationsModel(QObject* parent) : · 132 unmodified lines | ||
| 133 | 133 | refresh(); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | +UserLocationsModel::~UserLocationsModel() { | |
| 137 | + qDeleteAll(_locations); | |
| 138 | + _locations.clear(); | |
| 139 | +} | |
| 140 | + | |
| 136 | 141 | void UserLocationsModel::update() { |
| 137 | 142 | beginResetModel(); |
| 138 | 143 | endResetModel(); |
| @@ -151,6 +156,7 @@ void UserLocationsModel::renameLocation(const QModelIndex& index, const QString& · 12 unmodified lines | ||
| 151 | 156 | void UserLocationsModel::refresh() { |
| 152 | 157 | if (!_updating) { |
| 153 | 158 | beginResetModel(); |
| 159 | + qDeleteAll(_locations); | |
| 154 | 160 | _locations.clear(); |
| 155 | 161 | _updating = true; |
| 156 | 162 | endResetModel(); |