summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeoroutingmanager.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-14 15:28:13 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-19 14:51:59 +0200
commit88018b488a26bf3657960aed75c633bc13eb7aab (patch)
treedb9ad46ef7ab510dc41e36973cffd8f88332c157 /src/location/maps/qgeoroutingmanager.cpp
parente70c655366a9c30fcb15e7ed11a73623c7ee9b0c (diff)
downloadqtlocation-88018b488a26bf3657960aed75c633bc13eb7aab.tar.gz
Cleanup: apply rule of zero
Remove empty destructors, use std::unique_ptr where destructors only deleted a pointer member. This also closes the memory leak where the tile cache was never destroyed. Change-Id: I55007475b7f13a97d8399dd6d4234382106db05b Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Diffstat (limited to 'src/location/maps/qgeoroutingmanager.cpp')
-rw-r--r--src/location/maps/qgeoroutingmanager.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/location/maps/qgeoroutingmanager.cpp b/src/location/maps/qgeoroutingmanager.cpp
index 88719edc..fb3a1d38 100644
--- a/src/location/maps/qgeoroutingmanager.cpp
+++ b/src/location/maps/qgeoroutingmanager.cpp
@@ -91,14 +91,14 @@ QGeoRoutingManager::QGeoRoutingManager(QGeoRoutingManagerEngine *engine, QObject
: QObject(parent),
d_ptr(new QGeoRoutingManagerPrivate())
{
- d_ptr->engine = engine;
+ d_ptr->engine.reset(engine);
if (d_ptr->engine) {
d_ptr->engine->setParent(this);
- connect(d_ptr->engine, &QGeoRoutingManagerEngine::finished,
+ connect(d_ptr->engine.get(), &QGeoRoutingManagerEngine::finished,
this, &QGeoRoutingManager::finished);
- connect(d_ptr->engine, &QGeoRoutingManagerEngine::errorOccurred,
+ connect(d_ptr->engine.get(), &QGeoRoutingManagerEngine::errorOccurred,
this, &QGeoRoutingManager::errorOccurred);
} else {
qFatal("The routing manager engine that was set for this routing manager was NULL.");
@@ -328,10 +328,4 @@ Use deleteLater() instead.
/*******************************************************************************
*******************************************************************************/
-QGeoRoutingManagerPrivate::QGeoRoutingManagerPrivate() = default;
-QGeoRoutingManagerPrivate::~QGeoRoutingManagerPrivate()
-{
- delete engine;
-}
-
QT_END_NAMESPACE