diff options
author | George Hazan <ghazan@miranda.im> | 2019-09-02 12:55:01 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-09-02 12:55:01 +0300 |
commit | 28895567e575d5a017a1d1dcb8f2720fb1d0665f (patch) | |
tree | 9a4749752b367b31ccd5f02dc26b1d7e21ec6554 /protocols/FacebookRM/src | |
parent | 44ee2da9628ed8161d830f55371571bb1b77f5a3 (diff) |
Facebook: fix for rare crash after disabling FB account
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r-- | protocols/FacebookRM/src/connection.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp index 209f0efc91..d129524d44 100644 --- a/protocols/FacebookRM/src/connection.cpp +++ b/protocols/FacebookRM/src/connection.cpp @@ -41,21 +41,24 @@ void FacebookProto::ChangeStatus(void*) debugLogA("### Beginning SignOff process"); m_signingOut = true; - SetEvent(update_loop_event); + ::KillTimer(g_hwndHeartbeat, LPARAM(this)); + ::SetEvent(update_loop_event); // Shutdown and close channel handle Netlib_Shutdown(facy.hChannelCon); - if (facy.hChannelCon) + if (facy.hChannelCon) { Netlib_CloseHandle(facy.hChannelCon); - facy.hChannelCon = nullptr; + facy.hChannelCon = nullptr; + } // Shutdown and close messages handle Netlib_Shutdown(facy.hMessagesCon); - if (facy.hMessagesCon) + if (facy.hMessagesCon) { Netlib_CloseHandle(facy.hMessagesCon); - facy.hMessagesCon = nullptr; + facy.hMessagesCon = nullptr; + } - // Turn off chat on Facebook + // Turn off chat on Facebook if (getByte(FACEBOOK_KEY_DISCONNECT_CHAT, DEFAULT_DISCONNECT_CHAT)) facy.chat_state(false); @@ -139,7 +142,7 @@ void FacebookProto::ChangeStatus(void*) if (getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS, DEFAULT_SET_MIRANDA_STATUS)) ForkThread(&FacebookProto::SetAwayMsgWorker, nullptr); - SetTimer(g_hwndHeartbeat, LPARAM(this), 60000, timerApcFunc); + ::SetTimer(g_hwndHeartbeat, LPARAM(this), 60000, timerApcFunc); } else { ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_FAILED, (HANDLE)old_status, m_iStatus); |