Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
RunLoop must outlive Object
Browse files Browse the repository at this point in the history
~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.
  • Loading branch information
jfirebaugh committed May 2, 2015
1 parent 5013be1 commit aa19f07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mbgl/util/thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit aa19f07

Please sign in to comment.