From 7399bf2f2593b5944c55025ee7e2c3d1a0cfb112 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 3 May 2021 14:33:08 -0700 Subject: [PATCH] Ensure that AutoIsolateShutdown drops its reference to the DartIsolate on the intended task runner See https://github.com/flutter/flutter/issues/80964 --- testing/dart_isolate_runner.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testing/dart_isolate_runner.cc b/testing/dart_isolate_runner.cc index ea0048f638064..a4ec2704430b1 100644 --- a/testing/dart_isolate_runner.cc +++ b/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(); }