summaryrefslogtreecommitdiff
path: root/protocols/YAMN/src/account.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/YAMN/src/account.cpp')
-rw-r--r--protocols/YAMN/src/account.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/protocols/YAMN/src/account.cpp b/protocols/YAMN/src/account.cpp
index 7609a23e18..3c834b28cc 100644
--- a/protocols/YAMN/src/account.cpp
+++ b/protocols/YAMN/src/account.cpp
@@ -22,11 +22,6 @@ static mir_cs csFileWritingCS;
void CAccount::CheckMail()
{
- // we use event to signal, that running thread has all needed stack parameters copied
- HANDLE ThreadRunningEV = CreateEvent(nullptr, FALSE, FALSE, nullptr);
- if (ThreadRunningEV == nullptr)
- return;
-
// if we want to close miranda, we get event and do not run pop3 checking anymore
if (WAIT_OBJECT_0 == WaitForSingleObject(ExitEV, 0))
return;
@@ -35,18 +30,10 @@ void CAccount::CheckMail()
SReadGuard sra(AccountAccessSO, 0);
if (sra.Succeeded()) {
if ((Flags & YAMN_ACC_ENA) && Plugin->Fcn->SynchroFcnPtr) {
- CheckParam ParamToPlugin = { YAMN_CHECKVERSION, ThreadRunningEV, this };
-
TimeLeft = Interval;
- DWORD tid;
- HANDLE NewThread = CreateThread(nullptr, 0, (YAMN_STANDARDFCN)Plugin->Fcn->SynchroFcnPtr, &ParamToPlugin, 0, &tid);
- if (NewThread) {
- WaitForSingleObject(ThreadRunningEV, INFINITE);
- CloseHandle(NewThread);
- }
+ mir_forkThread<CheckParam>(Plugin->Fcn->SynchroFcnPtr, new CheckParam(this, g_plugin.CheckFlags()));
}
}
- CloseHandle(ThreadRunningEV);
}
void CAccount::RefreshContact()