mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Add COM initializition to Windows template (#54881)
Plugins, and the library, should be able to use COM without special setup. This adds COM initialization to the runner template so that it's available for any code on the main thread.
This commit is contained in:
parent
4acc2183d9
commit
0ece276ecb
@ -16,6 +16,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance,
|
||||
::AllocConsole();
|
||||
}
|
||||
|
||||
// Initialize COM, so that it is available for use in the library and/or plugins.
|
||||
::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
|
||||
|
||||
RunLoop run_loop;
|
||||
|
||||
flutter::DartProject project(L"data");
|
||||
@ -29,5 +32,6 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance,
|
||||
|
||||
run_loop.Run();
|
||||
|
||||
::CoUninitialize();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user