diff options
Diffstat (limited to 'protocols/CurrencyRates/src/Forex.cpp')
-rw-r--r-- | protocols/CurrencyRates/src/Forex.cpp | 18 |
1 files 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<HANDLE> 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<ICurrencyRatesProvider*>(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; |