Skip to content

Commit 7d43407

Browse files
committed
force Flutter to use a separate thread
* fixed performance issues
1 parent 7c5b43a commit 7d43407

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/windows/runner/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
1919

2020
flutter::DartProject project(L"data");
2121

22+
// TODO: Remove this. flutter/flutter/issues/178916
23+
// This forces Flutter to use a separate thread for Dart.
24+
// This mode will be removed in a future version of Flutter.
25+
project.set_ui_thread_policy(flutter::UIThreadPolicy::RunOnSeparateThread);
26+
2227
std::vector<std::string> command_line_arguments =
2328
GetCommandLineArguments();
2429

0 commit comments

Comments
 (0)