diff options
author | Andy Shaw <andy.shaw@qt.io> | 2018-03-28 10:10:57 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2018-03-28 10:22:32 +0000 |
commit | 747470873e66ad619378ed9a34a94a4c275d1312 (patch) | |
tree | c479ca25ac0e178802ae65c48f980d92d49263d2 /src/core/location_provider_qt.cpp | |
parent | 69c9f404b8411dc1808ba2799dacd7756d196e83 (diff) |
Don't recreate the position info source if we already have one
Task-number: QTBUG-67279
Change-Id: Iff2466cfe3b8bbdb77066f3318014fcb51e2e402
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/location_provider_qt.cpp')
-rw-r--r-- | src/core/location_provider_qt.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp index 5f0df2c0c..d0b783b20 100644 --- a/src/core/location_provider_qt.cpp +++ b/src/core/location_provider_qt.cpp @@ -104,7 +104,8 @@ static bool isHighAccuracySource(const QGeoPositionInfoSource *source) void QtPositioningHelper::start(bool highAccuracy) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - m_positionInfoSource = QGeoPositionInfoSource::createDefaultSource(this); + if (!m_positionInfoSource) + m_positionInfoSource = QGeoPositionInfoSource::createDefaultSource(this); if (!m_positionInfoSource) { qWarning("Failed to initialize location provider: The system either has no default " "position source, no valid plugins could be found or the user does not have " |