summaryrefslogtreecommitdiff
path: root/src/mbgl/util/thread.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-05-02 12:57:25 -0400
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-05-02 12:57:25 -0400
commitaa19f07ccf6b21737904b6e96b30eff69edb1fd7 (patch)
treecfb6cd641e2663d1961df40ada2261ca6e48f054 /src/mbgl/util/thread.hpp
parent5013be138e33641ef78aec672ce41f20624b9269 (diff)
downloadqtlocation-mapboxgl-aa19f07ccf6b21737904b6e96b30eff69edb1fd7.tar.gz
RunLoop must outlive Object
~Object is likely to join threads that want to dispatch results back to this RunLoop. This happens, for example, when MapContext is destructed: it joins the worker threads, which need to complete work before shutting down.
Diffstat (limited to 'src/mbgl/util/thread.hpp')
-rw-r--r--src/mbgl/util/thread.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/util/thread.hpp b/src/mbgl/util/thread.hpp
index 0d46d12b72..55c3d4d281 100644
--- a/src/mbgl/util/thread.hpp
+++ b/src/mbgl/util/thread.hpp
@@ -122,12 +122,12 @@ void Thread<Object>::run(P&& params, index_sequence<I...>) {
uv::loop l;
{
- Object object_(l.get(), std::get<I>(std::forward<P>(params))...);
- object = &object_;
-
RunLoop loop_(l.get());
loop = &loop_;
+ Object object_(l.get(), std::get<I>(std::forward<P>(params))...);
+ object = &object_;
+
running.set_value();
l.run();