From 743619dee9056d902de6ea6890f4997b5b4cbe42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 27 Mar 2015 16:45:17 +0100 Subject: Disable all Sources when terminating --- src/mbgl/map/map.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1