Chris Bracken 105625bb77 [Windows] Shut down VM on shutdown of last engine (flutter/engine#35251)
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
2022-08-09 17:44:40 +01:00
..