mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Fix crashing in Windows Insiders builds (#2562)
Added missing initialization of winrt apartment
This commit is contained in:
committed by
GitHub
parent
6cd0f83496
commit
0f6563e8e0
@@ -227,6 +227,8 @@ void XamlBridge::OnTakeFocusRequested(winrt::Windows::UI::Xaml::Hosting::Desktop
|
||||
HWND XamlBridge::InitDesktopWindowsXamlSource(winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource desktopSource)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
winrt::init_apartment(apartment_type::single_threaded);
|
||||
winxamlmanager = WindowsXamlManager::InitializeForCurrentThread();
|
||||
|
||||
auto interop = desktopSource.as<IDesktopWindowXamlSourceNative>();
|
||||
// Parent the DesktopWindowXamlSource object to current window
|
||||
@@ -258,6 +260,8 @@ void XamlBridge::ClearXamlIslands()
|
||||
xamlSource.Close();
|
||||
}
|
||||
m_xamlSources.clear();
|
||||
|
||||
winxamlmanager.Close();
|
||||
}
|
||||
|
||||
// Function invoked when the window is destroyed
|
||||
|
||||
Reference in New Issue
Block a user