From a5ae88c84238b344772f5dd1c4905071ebe6cd05 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 6 Mar 2025 10:56:36 +0300 Subject: CurrencyRates: broken pieces of the old code removed --- protocols/CurrencyRates/src/Forex.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/protocols/CurrencyRates/src/Forex.cpp b/protocols/CurrencyRates/src/Forex.cpp index 45477a453f..1f2e72b2ff 100644 --- a/protocols/CurrencyRates/src/Forex.cpp +++ b/protocols/CurrencyRates/src/Forex.cpp @@ -22,9 +22,6 @@ HGENMENU g_hMenuChart = nullptr; #endif HGENMENU g_hMenuRefresh = nullptr, g_hMenuRoot = nullptr; -typedef std::vector THandles; -static THandles g_ahThreads; - static HGENMENU g_hEnableDisableMenu; static HANDLE g_hTBButton; @@ -172,7 +169,7 @@ int CurrencyRates_OnToolbarLoaded(WPARAM, LPARAM) static void WorkingThread(void *pParam) { - ICurrencyRatesProvider *pProvider = reinterpret_cast(pParam); + auto *pProvider = (ICurrencyRatesProvider *)pParam; assert(pProvider); if (pProvider) @@ -196,7 +193,7 @@ int CurrencyRatesEventFunc_OnModulesLoaded(WPARAM, LPARAM) ::ResetEvent(g_hEventWorkThreadStop); - g_ahThreads.push_back(mir_forkthread(WorkingThread, g_pCurrentProvider)); + mir_forkthread(WorkingThread, g_pCurrentProvider); return 0; } @@ -215,15 +212,6 @@ INT_PTR CurrencyRateProtoFunc_GetStatus(WPARAM, LPARAM) return g_bAutoUpdate ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE; } -void WaitForWorkingThreads() -{ - size_t cThreads = g_ahThreads.size(); - if (cThreads > 0) { - HANDLE* paHandles = &*(g_ahThreads.begin()); - ::WaitForMultipleObjects((uint32_t)cThreads, paHandles, TRUE, INFINITE); - } -} - int CurrencyRatesEventFunc_PreShutdown(WPARAM, LPARAM) { ::SetEvent(g_hEventWorkThreadStop); @@ -333,8 +321,6 @@ int CMPlugin::Load(void) int CMPlugin::Unload(void) { - WaitForWorkingThreads(); - ClearProviders(); ::CloseHandle(g_hEventWorkThreadStop); return 0; -- cgit v1.2.3