summaryrefslogtreecommitdiff
path: root/src/location
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-05-22 09:50:50 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-05-22 09:28:39 +0000
commitb777cec7dede33e061030efc95f06ba37e9e8869 (patch)
treefa8484953d001e203e1088f84f5f185779dd2d47 /src/location
parent55bbdc5ee5d7891676c1474ce51cbb6971efbdfb (diff)
downloadqtlocation-b777cec7dede33e061030efc95f06ba37e9e8869.tar.gz
Fix MapObjectView object removal
Call delegateModel.cancel if the object is still incubating Change-Id: Iee4af5530b6a00981280b9531cc3c1643db71d03 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/location')
-rw-r--r--src/location/labs/qmapobjectview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/location/labs/qmapobjectview.cpp b/src/location/labs/qmapobjectview.cpp
index 175e7cc4..2ffc27bc 100644
--- a/src/location/labs/qmapobjectview.cpp
+++ b/src/location/labs/qmapobjectview.cpp
@@ -311,8 +311,10 @@ void QMapObjectView::removeMapObjectFromMap(int index)
{
if (index >= 0 && index < m_instantiatedMapObjects.size()) {
QGeoMapObject *mo = m_instantiatedMapObjects.takeAt(index);
- if (!mo)
+ if (!mo) {
+ m_delegateModel->cancel(index);
return;
+ }
mo->setMap(nullptr);
m_delegateModel->release(mo);
}