Commit 016b4fb4 authored by Volker Krause's avatar Volker Krause
Browse files

Reset the floor level change model when the map data changes

Otherwise we potentially hold invalid references to OSM elements here.
parent 78a6daf5
......@@ -81,7 +81,17 @@ void FloorLevelChangeModel::setFloorLevelModel(FloorLevelModel *floorLevelModel)
return;
}
if (m_floorLevelModel) {
disconnect(m_floorLevelModel, &FloorLevelModel::modelAboutToBeReset, this, nullptr);
}
m_floorLevelModel = floorLevelModel;
connect(m_floorLevelModel, &FloorLevelModel::modelAboutToBeReset, this, [this]() {
beginResetModel();
m_element = {};
m_levels.clear();
endResetModel();
});
Q_EMIT contentChanged();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment