diff options
author | David Laing <david.laing@nokia.com> | 2011-12-07 11:00:32 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-07 08:48:32 +0100 |
commit | dc932f3fc68467d59a224654e503898d9f8acbc7 (patch) | |
tree | a29cf31033e4431a0f8f2ed2ea7def09180b1578 /src/location/maps/qgeomappingmanager.cpp | |
parent | e386aca2bd208e01f59b680867fe9a70c56a9649 (diff) |
Fixes the threading issues with maps.
The threading is about to be reworked so that multiple maps can
make use of the same mapping manager engine, which will change the
way this works quite a bit.
That means that this change is effectively a temporary fix to
unblock the CI, although aspects of this change will most likely
reappear in the new version.
Change-Id: I34377e69c15ac8de350308b99d84f8bd121e145c
Reviewed-by: Juha Vuolle <juha.vuolle@nokia.com>
Diffstat (limited to 'src/location/maps/qgeomappingmanager.cpp')
-rw-r--r-- | src/location/maps/qgeomappingmanager.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/location/maps/qgeomappingmanager.cpp b/src/location/maps/qgeomappingmanager.cpp index e2ff4b40..ea115f7e 100644 --- a/src/location/maps/qgeomappingmanager.cpp +++ b/src/location/maps/qgeomappingmanager.cpp @@ -116,24 +116,28 @@ QGeoMappingManager::QGeoMappingManager(QGeoMappingManagerEngine *engine, QObject SIGNAL(queueFinished()), Qt::QueuedConnection); + connect(d_ptr->engine, + SIGNAL(initialized()), + this, + SIGNAL(initialized())); + + d_ptr->engine->moveToThread(d_ptr->thread); + connect(d_ptr->thread, SIGNAL(started()), d_ptr->engine, - SLOT(threadStarted()), - Qt::QueuedConnection); + SLOT(threadStarted())); connect(d_ptr->thread, SIGNAL(finished()), d_ptr->engine, - SLOT(threadFinished()), - Qt::QueuedConnection); + SLOT(threadFinished())); connect(d_ptr->engine, - SIGNAL(initialized()), - this, - SIGNAL(initialized())); + SIGNAL(destroyed()), + d_ptr->thread, + SLOT(deleteLater())); - d_ptr->engine->moveToThread(d_ptr->thread); QTimer::singleShot(0, d_ptr->thread, SLOT(start())); } @@ -317,9 +321,6 @@ QGeoMappingManagerPrivate::QGeoMappingManagerPrivate() QGeoMappingManagerPrivate::~QGeoMappingManagerPrivate() { thread->quit(); - if (engine) - engine->deleteLater(); - thread->deleteLater(); } #include "moc_qgeomappingmanager.cpp" |