diff options
author | Alex Wilson <alex.wilson@nokia.com> | 2012-03-19 13:47:39 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-20 04:43:30 +0100 |
commit | c282313c67508d24943932201dff9a3f3231fe3b (patch) | |
tree | a4bdf1e2c18bcf6752c94821a46988ab82d960a0 /src/location | |
parent | d7893611fbc8c5ecfa145cb31320b4b78d0a6923 (diff) | |
download | qtlocation-c282313c67508d24943932201dff9a3f3231fe3b.tar.gz |
Fix for pipelined tile requests receiving incorrect data
Calling abort() and then deleteLater() without waiting for finished()
and friends to come back turns out to be a Bad Idea. QNAM won't be
able to correctly handle the abortion if the request is occupying a
slot in a pipeline queue, and that queue will be off-by-one for the
remainder of its operation.
Fix is to change the finished() connection to be Queued, and simply
call abort rather than deleteLater() as well. Then in the queued
finished() handler, deleteLater() will be called and all will be
well (hopefully).
Change-Id: Ia572757af8394297fa707f0d8d1accded2eec12d
Reviewed-by: David Laing <david.laing@nokia.com>
Diffstat (limited to 'src/location')
-rw-r--r-- | src/location/maps/qgeotilefetcher.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/location/maps/qgeotilefetcher.cpp b/src/location/maps/qgeotilefetcher.cpp index fb7cbb54..6ebde313 100644 --- a/src/location/maps/qgeotilefetcher.cpp +++ b/src/location/maps/qgeotilefetcher.cpp @@ -128,13 +128,8 @@ void QGeoTileFetcher::cancelTileRequests(const QSet<QGeoTileSpec> &tiles) for (; tile != end; ++tile) { QGeoTiledMapReply* reply = d->invmap_.value(*tile, 0); if (reply) { - /* when we call abort() it will directly emit finished(), so - * we must disconnect it first to avoid recursing on the lock */ - disconnect(reply, SIGNAL(finished()), - this, SLOT(finished())); d->invmap_.remove(*tile); reply->abort(); - reply->deleteLater(); } d->queue_.removeAll(*tile); } @@ -167,7 +162,8 @@ void QGeoTileFetcher::requestNextTile() connect(reply, SIGNAL(finished()), this, - SLOT(finished())); + SLOT(finished()), + Qt::QueuedConnection); d->invmap_.insert(ts, reply); } |