summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-10-31 13:13:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-10-31 13:13:13 +0300
commit9437834f8f4d3abf32a8629747385d666c652084 (patch)
tree3756bbc3e4648bf539ab78a891697f9a4e89690f /protocols/SkypeWeb/src/skype_proto.cpp
parentce8b02d7c3df822605392d3e8e6f817953af0864 (diff)
fixes #1011 (thread-unsafe code in SkypeWeb)
Diffstat (limited to 'protocols/SkypeWeb/src/skype_proto.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index e6d76d9e10..e1c3368f74 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -23,9 +23,9 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) :
m_InviteDialogs(1),
m_GCCreateDialogs(1),
m_OutMessages(3, PtrKeySortT),
- m_bThreadsTerminated(0),
- m_TrouterConnection(0),
- m_pollingConnection(0),
+ m_bThreadsTerminated(false),
+ m_TrouterConnection(nullptr),
+ m_pollingConnection(nullptr),
m_opts(this),
Contacts(this)
{
@@ -60,25 +60,25 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) :
CSkypeProto::~CSkypeProto()
{
requestQueue->Stop();
- delete requestQueue;
+ delete requestQueue; requestQueue = nullptr;
UnInitNetwork();
UninitPopups();
if (m_hPollingThread) {
- TerminateThread(m_hPollingThread, NULL);
+ WaitForSingleObject(m_hPollingThread, INFINITE);
m_hPollingThread = NULL;
}
if (m_hTrouterThread) {
- TerminateThread(m_hTrouterThread, NULL);
+ WaitForSingleObject(m_hTrouterThread, INFINITE);
m_hTrouterThread = NULL;
}
SkypeUnsetTimer();
}
-int CSkypeProto::OnPreShutdown(WPARAM, LPARAM)
+int CSkypeProto::OnExit()
{
debugLogA(__FUNCTION__);
@@ -299,7 +299,7 @@ int CSkypeProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam
return OnInitStatusMenu();
case EV_PROTO_ONEXIT:
- return OnPreShutdown(wParam, lParam);
+ return OnExit();
}
return 1;