summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-03-27 18:32:46 +0100
committerKonstantin Käfer <mail@kkaefer.com>2015-03-27 18:32:46 +0100
commit2e4d583d3cac794ea89563f5fc2691b8267a359e (patch)
treed194a2be2306fc7b177bc574603b6b4677d64827
parente4469c912261ad0711f75f7f0018b9fffa6f91a7 (diff)
parent743619dee9056d902de6ea6890f4997b5b4cbe42 (diff)
downloadqtlocation-mapboxgl-2e4d583d3cac794ea89563f5fc2691b8267a359e.tar.gz
Merge pull request #1104 from mapbox/1104-worker-dispatch-crash
HTTPRequest handleResponse
-rw-r--r--src/mbgl/map/map.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 0863c8aad6..7bc91ed48c 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -129,8 +129,15 @@ void Map::start(bool startPaused) {
// Remove all of these to make sure they are destructed in the correct thread.
style.reset();
+
+ // Since we don't have a stylesheet anymore, this will disable all Sources and cancel
+ // their associated requests.
+ updateSources();
+ assert(activeSources.empty());
+
+ // It's now safe to destroy/join the workers since there won't be any more callbacks that
+ // could dispatch to the worker pool.
workers.reset();
- activeSources.clear();
terminating = true;