From 7ac239793b33cfc1e7b04a05080e6d8382a5a8ad Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 16 Aug 2022 12:27:24 +0300 Subject: VoiceService: fix for an occasional crash on exit --- plugins/VoiceService/src/hooks.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins/VoiceService/src/hooks.cpp') diff --git a/plugins/VoiceService/src/hooks.cpp b/plugins/VoiceService/src/hooks.cpp index b9c41336d6..52a8eafbda 100644 --- a/plugins/VoiceService/src/hooks.cpp +++ b/plugins/VoiceService/src/hooks.cpp @@ -76,8 +76,6 @@ static INT_PTR CMAnswer(WPARAM wParam, LPARAM lParam); static INT_PTR CMHold(WPARAM wParam, LPARAM lParam); static INT_PTR CMDrop(WPARAM wParam, LPARAM lParam); -static VOID CALLBACK ClearOldVoiceCalls(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); - class CallingMethod { public: @@ -417,7 +415,7 @@ VoiceCall* FindVoiceCall(MCONTACT hContact) return nullptr; } -static VOID CALLBACK ClearOldVoiceCalls(HWND, UINT, UINT_PTR, DWORD) +void Timers::ClearEvents(CTimer*) { DWORD now = GetTickCount(); bool refresh = false; @@ -692,7 +690,7 @@ int ModulesLoaded(WPARAM, LPARAM) g_plugin.addSound(it.szName, LPGENW("Voice Calls"), it.wszDescr); g_plugin.addSound("voice_dialpad", LPGENW("Voice Calls"), LPGENW("Dialpad press")); - SetTimer(NULL, 0, 1000, ClearOldVoiceCalls); + g_timers.m_timer.Start(1000); // Accounts for (auto *pa : Accounts()) @@ -704,6 +702,7 @@ int ModulesLoaded(WPARAM, LPARAM) int PreShutdown(WPARAM, LPARAM) { + g_timers.m_timer.Stop(); DeInitFrames(); DeInitOptions(); return 0; -- cgit v1.2.3