From 4d71fc5b8b3b549122101e8948b986d6f863b87e Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 6 May 2021 20:24:02 -0700 Subject: [PATCH] Ensure that AutoIsolateShutdown drops its reference to the DartIsolate on the intended task runner (flutter/engine#25899) --- engine/src/flutter/testing/dart_isolate_runner.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/src/flutter/testing/dart_isolate_runner.cc b/engine/src/flutter/testing/dart_isolate_runner.cc index ea0048f638..a4ec270443 100644 --- a/engine/src/flutter/testing/dart_isolate_runner.cc +++ b/engine/src/flutter/testing/dart_isolate_runner.cc @@ -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(); }