mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Fix deadlock when opening settings window
This commit is contained in:
parent
faf52c38bb
commit
74a9681c8e
|
|
@ -261,6 +261,14 @@ std::optional<std::string> GetTextInWindow(const std::string &window)
|
|||
return {};
|
||||
}
|
||||
|
||||
DWORD pid = 0;
|
||||
DWORD thid = 0;
|
||||
thid = GetWindowThreadProcessId(hwnd, &pid);
|
||||
// Calling CoCreateInstance() on the OBS windows might cause a deadlock
|
||||
if (GetCurrentProcessId() == pid) {
|
||||
return {};
|
||||
}
|
||||
|
||||
IUIAutomation *automation = nullptr;
|
||||
auto hr = CoCreateInstance(__uuidof(CUIAutomation), nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user