summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <[email protected]>2016-07-03 19:51:17 +0200
committerDennis Nienhüser <[email protected]>2016-07-03 19:51:17 +0200
commitebfb0cd9de4cc3941f66b00464338da97c655018 (patch)
tree3d328e8115f632c3d0ef331e79e79f1a1549e0e7
parentb256a1f413e7138ef3a971802293f160d9a25893 (diff)
Use delayed deletion
-rw-r--r--src/lib/marble/declarative/MarbleQuickItem.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/marble/declarative/MarbleQuickItem.cpp b/src/lib/marble/declarative/MarbleQuickItem.cpp
index ff30086..d8598f2 100644
--- a/src/lib/marble/declarative/MarbleQuickItem.cpp
+++ b/src/lib/marble/declarative/MarbleQuickItem.cpp
@@ -436,7 +436,7 @@ namespace Marble
delete d->m_placemarkItem;
d->m_placemarkItem = nullptr;
delete d->m_placemark;
- d->m_placemark = new Placemark;
+ d->m_placemark = new Placemark(this);
d->m_placemark->coordinate()->setCoordinates(coordinates);
d->m_reverseGeocoding.reverseGeocoding(coordinates);
}
@@ -557,11 +557,11 @@ namespace Marble
if (feature->nodeType() == GeoDataTypes::GeoDataPlacemarkType) {
GeoDataPlacemark const * placemark = static_cast<const GeoDataPlacemark*>(feature);
if (d->m_placemark && placemark->coordinate() == d->m_placemark->coordinate()->coordinates()) {
- delete d->m_placemark;
+ d->m_placemark->deleteLater();
d->m_placemark = nullptr;
} else {
- delete d->m_placemark;
- d->m_placemark = new Placemark;
+ d->m_placemark->deleteLater();
+ d->m_placemark = new Placemark(this);
d->m_placemark->setGeoDataPlacemark(*placemark);
}
delete d->m_placemarkItem;