UI: Add OBSBasic::ClearHotkeys function

Add a function to clear basic window hotkeys to reduces potential code
duplication
This commit is contained in:
jp9000
2015-06-29 00:47:07 -07:00
parent 412fbfce82
commit c9f85f167c
2 changed files with 8 additions and 2 deletions

View File

@@ -906,6 +906,12 @@ void OBSBasic::CreateHotkeys()
#undef MAKE_CALLBACK
}
void OBSBasic::ClearHotkeys()
{
obs_hotkey_pair_unregister(streamingHotkeys);
obs_hotkey_pair_unregister(recordingHotkeys);
}
OBSBasic::~OBSBasic()
{
bool previewEnabled = obs_preview_enabled();
@@ -920,8 +926,7 @@ OBSBasic::~OBSBasic()
os_cpu_usage_info_destroy(cpuUsageInfo);
obs_hotkey_set_callback_routing_func(nullptr, nullptr);
obs_hotkey_pair_unregister(streamingHotkeys);
obs_hotkey_pair_unregister(recordingHotkeys);
ClearHotkeys();
service = nullptr;
outputHandler.reset();

View File

@@ -122,6 +122,7 @@ private:
void InitHotkeys();
void CreateHotkeys();
void ClearHotkeys();
bool InitService();