forked from firka/flutter
Ensure that AutoIsolateShutdown drops its reference to the DartIsolate on the intended task runner (flutter/engine#25899)
This commit is contained in:
@@ -17,11 +17,11 @@ AutoIsolateShutdown::~AutoIsolateShutdown() {
|
||||
Shutdown();
|
||||
}
|
||||
fml::AutoResetWaitableEvent latch;
|
||||
fml::TaskRunner::RunNowOrPostTask(runner_,
|
||||
[isolate = std::move(isolate_), &latch]() {
|
||||
// Delete isolate on thread.
|
||||
latch.Signal();
|
||||
});
|
||||
fml::TaskRunner::RunNowOrPostTask(runner_, [this, &latch]() {
|
||||
// Delete isolate on thread.
|
||||
isolate_.reset();
|
||||
latch.Signal();
|
||||
});
|
||||
latch.Wait();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user