From 5eba89621355c33785278d92b88bb4168475d72c Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 14 Sep 2015 21:29:34 +0000 Subject: Tox: fix crash when going offline git-svn-id: http://svn.miranda-ng.org/main/trunk@15356 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_core.cpp | 2 +- protocols/Tox/src/tox_network.cpp | 2 +- protocols/Tox/src/tox_options.cpp | 2 +- protocols/Tox/src/tox_proto.cpp | 1 - protocols/Tox/src/tox_proto.h | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp index 225e04b7df..a2da0b3e85 100644 --- a/protocols/Tox/src/tox_core.cpp +++ b/protocols/Tox/src/tox_core.cpp @@ -41,7 +41,7 @@ Tox_Options* CToxProto::GetToxOptions() return options; } -bool CToxProto::InitToxCore(CToxThread *toxThread) +bool CToxProto::InitToxCore() { logger->Log(__FUNCTION__": initializing tox core"); diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index 0071d9b3f8..ea090920c5 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -148,7 +148,7 @@ void CToxProto::PollingThread(void*) logger->Log(__FUNCTION__": entering"); - if (!InitToxCore(&toxThread)) + if (!InitToxCore()) { SetStatus(ID_STATUS_OFFLINE); ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, (HANDLE)NULL, LOGINERR_WRONGPASSWORD); diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 9d9cebee7b..1954ecc147 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -84,7 +84,7 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) } } - if (m_proto->InitToxCore(&toxThread)) + if (m_proto->InitToxCore()) { TCHAR *group = m_group.GetText(); if (mir_tstrlen(group) > 0 && Clist_GroupExists(group)) diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index a9b749f184..33da319fc4 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -158,7 +158,6 @@ int CToxProto::SetStatus(int iNewStatus) if (toxThread) { toxThread->Stop(); - toxThread = NULL; } if (!Miranda_Terminated()) diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index f9efa6a059..04c9a8849f 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -87,7 +87,7 @@ private: // tox core Tox_Options* GetToxOptions(); - bool InitToxCore(CToxThread *toxThread); + bool InitToxCore(); void UninitToxCore(); // tox network -- cgit v1.2.3