mirror of https://github.com/PCSX2/pcsx2.git
DInputSource: Fix incorrect unlock on failure
This commit is contained in:
parent
2de6a5029f
commit
2d7289a248
|
@ -96,12 +96,13 @@ bool DInputSource::Initialize(SettingsInterface& si, std::unique_lock<std::mutex
|
|||
// need to release the lock while we're enumerating, because we call winId().
|
||||
settings_lock.unlock();
|
||||
const std::optional<WindowInfo> toplevel_wi(Host::GetTopLevelWindowInfo());
|
||||
settings_lock.lock();
|
||||
|
||||
if (!toplevel_wi.has_value() || toplevel_wi->type != WindowInfo::Type::Win32)
|
||||
{
|
||||
Console.Error("Missing top level window, cannot add DInput devices.");
|
||||
return false;
|
||||
}
|
||||
settings_lock.lock();
|
||||
|
||||
m_toplevel_window = static_cast<HWND>(toplevel_wi->window_handle);
|
||||
ReloadDevices();
|
||||
|
|
Loading…
Reference in New Issue