summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_threads.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-06-01 13:04:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-06-01 13:18:23 +0300
commit66f23519bec4707cd00b934da258cd66e89831a4 (patch)
tree263abb9531e3fb1493d928843a34277e24a827bd /protocols/MSN/src/msn_threads.cpp
parent0d3c50e1d4280ab0622326cd77224f2ce6aa4e77 (diff)
fixes #1388 (MSN: crash on "msn_misc.cpp (580): ThreadData::sendPacketPayload")
Diffstat (limited to 'protocols/MSN/src/msn_threads.cpp')
-rw-r--r--protocols/MSN/src/msn_threads.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp
index 4f762b02e8..e0db9495fa 100644
--- a/protocols/MSN/src/msn_threads.cpp
+++ b/protocols/MSN/src/msn_threads.cpp
@@ -253,36 +253,24 @@ void __cdecl CMsnProto::MSNServerThread(void* arg)
LBL_Exit:
if (info->mIsMainThread) {
- /*
- if (!isConnectSuccess && !usingGateway && m_iDesiredStatus != ID_STATUS_OFFLINE) {
- msnNsThread = NULL;
- usingGateway = true;
+ msnNsThread = nullptr;
- ThreadData* newThread = new ThreadData;
- newThread->mType = SERVER_NOTIFICATION;
- newThread->mIsMainThread = true;
-
- newThread->startThread(&CMsnProto::MSNServerThread, this);
+ if (hKeepAliveThreadEvt) {
+ msnPingTimeout *= -1;
+ SetEvent(hKeepAliveThreadEvt);
}
- else*/ {
- if (hKeepAliveThreadEvt) {
- msnPingTimeout *= -1;
- SetEvent(hKeepAliveThreadEvt);
- }
-
- if (info->s == nullptr)
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NONETWORK);
- else
- MSN_CloseConnections();
- if (hHttpsConnection) {
- Netlib_CloseHandle(hHttpsConnection);
- hHttpsConnection = nullptr;
- }
+ if (info->s == nullptr)
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NONETWORK);
+ else
+ MSN_CloseConnections();
- MSN_GoOffline();
- msnNsThread = nullptr;
+ if (hHttpsConnection) {
+ Netlib_CloseHandle(hHttpsConnection);
+ hHttpsConnection = nullptr;
}
+
+ MSN_GoOffline();
}
debugLogA("Thread [%08X] ending now", GetCurrentThreadId());