Add error handling for all possible failing of winrt::check_result (#8278)

This commit is contained in:
Mykhailo Pylyp
2020-12-01 12:03:24 +02:00
committed by GitHub
parent c6078e3136
commit d9ca68e6ea
2 changed files with 37 additions and 4 deletions

View File

@@ -233,7 +233,16 @@ void OverlayWindow::enable()
winkey_popup->apply_overlay_opacity(((float)overlayOpacity.value) / 100.0f);
winkey_popup->set_theme(theme.value);
target_state = std::make_unique<TargetState>(pressTime.value);
winkey_popup->initialize();
try
{
winkey_popup->initialize();
}
catch (...)
{
Logger::critical("Winkey popup failed to initialize");
return;
}
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
const bool hook_disabled = IsDebuggerPresent();
#else