Merge pull request #79693 from bruvzg/com_ath
[Windows] Initialize COM as apartment-threaded.
This commit is contained in:
commit
048a164083
|
@ -706,7 +706,7 @@ void AudioDriverWASAPI::write_sample(WORD format_tag, int bits_per_sample, BYTE
|
|||
}
|
||||
|
||||
void AudioDriverWASAPI::thread_func(void *p_udata) {
|
||||
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
|
||||
|
||||
AudioDriverWASAPI *ad = static_cast<AudioDriverWASAPI *>(p_udata);
|
||||
uint32_t avail_frames = 0;
|
||||
|
|
|
@ -278,7 +278,12 @@ Error DisplayServerWindows::file_dialog_show(const String &p_title, const String
|
|||
pfd->SetFileTypes(filters.size(), filters.ptr());
|
||||
pfd->SetFileTypeIndex(0);
|
||||
|
||||
hr = pfd->Show(nullptr);
|
||||
WindowID window_id = _get_focused_window_or_popup();
|
||||
if (!windows.has(window_id)) {
|
||||
window_id = MAIN_WINDOW_ID;
|
||||
}
|
||||
|
||||
hr = pfd->Show(windows[window_id].hWnd);
|
||||
if (SUCCEEDED(hr)) {
|
||||
Vector<String> file_names;
|
||||
|
||||
|
|
|
@ -1714,7 +1714,7 @@ String OS_Windows::get_system_ca_certificates() {
|
|||
OS_Windows::OS_Windows(HINSTANCE _hInstance) {
|
||||
hInstance = _hInstance;
|
||||
|
||||
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
|
||||
|
||||
#ifdef WASAPI_ENABLED
|
||||
AudioDriverManager::add_driver(&driver_wasapi);
|
||||
|
|
Loading…
Reference in New Issue