Skip to content

Commit

Permalink
Tear down the shell before terminating message loops on host threads. (
Browse files Browse the repository at this point in the history
…flutter#5207)

Shell teardown is synchronous. The shell was attempting to destroy components on a quitting message loop. The message loop implementation was executing such tasks on the calling thread which the shell does not consider thread safe.
  • Loading branch information
chinmaygarde authored May 8, 2018
1 parent 11d6da3 commit f64f64e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions content_handler/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ Engine::Engine(Delegate& delegate,
}

Engine::~Engine() {
shell_.reset();
for (const auto& thread : host_threads_) {
thread.TaskRunner()->PostTask(
[]() { fsl::MessageLoop::GetCurrent()->PostQuitTask(); });
Expand Down

0 comments on commit f64f64e

Please sign in to comment.