diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-03-27 16:45:17 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-03-27 17:09:25 +0100 |
commit | 743619dee9056d902de6ea6890f4997b5b4cbe42 (patch) | |
tree | d194a2be2306fc7b177bc574603b6b4677d64827 | |
parent | e4469c912261ad0711f75f7f0018b9fffa6f91a7 (diff) | |
download | qtlocation-mapboxgl-743619dee9056d902de6ea6890f4997b5b4cbe42.tar.gz |
Disable all Sources when terminating
-rw-r--r-- | src/mbgl/map/map.cpp | 9 |
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; |