mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
All Flutter engines in the same process share a common Dart VM, which is launched with the start of the first engine in the process and should be terminated when the last engine in the process has been deallocated. Formerly, it was not possible to cleanly shut down and restart the VM in a process, but this was resolved in the Dart SDK and a flag exposed in flutter/engine#10652. Since some embedders take advantage of the fact that the VM remains running after engine shutdown, this flag is not enabled by default, however it should be enabled for the Windows embedder, which we control. No tests added since this is not testable via any API to which the Windows embedder has access. The behaviour of this flag is tested in the embedder API tests in `EmbedderTest.VMShutsDownWhenNoEnginesInProcess` in shell/platform/embedder/tests/embedder_unittests.cc. Issue: https://github.com/flutter/flutter/issues/109191