diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-02-28 11:02:56 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-02-28 10:27:19 +0000 |
commit | 0ac5180d59bcdf66d9c9f75432a36713beee308d (patch) | |
tree | 8b42cf4f55d34d0ea043ad108fff566008170b8a /src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp | |
parent | 39997e31218e9c233f52668cbd730f8d871e0ab9 (diff) | |
download | qtlocation-0ac5180d59bcdf66d9c9f75432a36713beee308d.tar.gz |
Reduce the amount of mutexed code
Change-Id: Ic0dfe488ba8aafb0f3ca3a2b6209d59484d07af8
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp')
-rw-r--r-- | src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp b/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp index f932d3de..a759edf4 100644 --- a/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp +++ b/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp @@ -163,11 +163,12 @@ QSharedPointer<QGeoTileTexture> QGeoFileTileCacheOsm::getFromOfflineStorage(cons { QMutexLocker locker(&storageLock); if (m_tilespecToOfflineFilepath.contains(spec)) { - QFile file(m_tilespecToOfflineFilepath[spec]); + const QString fileName = m_tilespecToOfflineFilepath[spec]; + locker.unlock(); + QFile file(fileName); file.open(QIODevice::ReadOnly); QByteArray bytes = file.readAll(); file.close(); - locker.unlock(); QImage image; if (!image.loadFromData(bytes)) { |