Hack to prevent thread from corrupting config

Following previous reverts, fixes a number of isses with ConfigFile, and
prevents the hotkey thread from potentially corrupting the config file.

The user will no longer be able to update these two settings in real
time, but at this point I'd rather spend time on the new version rather
than make fixes that require too much time.
master
jp9000 2015-01-23 16:57:30 -08:00
parent 521a90585a
commit 34f088cf32
1 changed files with 11 additions and 2 deletions

View File

@ -811,8 +811,17 @@ void OBSAPIInterface::HandleHotkeys()
{
List<DWORD> hitKeys;
bool allow_other_hotkey_modifiers = !!GlobalConfig->GetInt(TEXT("General"), TEXT("AllowOtherHotkeyModifiers"), true);
bool uplay_overlay_compatibility = !!GlobalConfig->GetInt(L"General", L"UplayOverlayCompatibility", false);
static bool allow_other_hotkey_modifiers;
static bool uplay_overlay_compatibility;
static bool set_vars = false;
/* only query these config variables once */
if (!set_vars)
{
allow_other_hotkey_modifiers = !!GlobalConfig->GetInt(TEXT("General"), TEXT("AllowOtherHotkeyModifiers"), true);
uplay_overlay_compatibility = !!GlobalConfig->GetInt(L"General", L"UplayOverlayCompatibility", false);
set_vars = true;
}
DWORD modifiers = 0;
if(GetAsyncKeyState(VK_MENU) & 0x8000)