From 75d27e475943eafbcb52e9a795554358c9348fbd Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 30 Oct 2015 17:58:45 +0000 Subject: Tox: fixed profile creation and import git-svn-id: http://svn.miranda-ng.org/main/trunk@15654 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_core.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'protocols/Tox/src/tox_core.cpp') diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp index 335743303b..a500d84be9 100644 --- a/protocols/Tox/src/tox_core.cpp +++ b/protocols/Tox/src/tox_core.cpp @@ -41,21 +41,19 @@ Tox_Options* CToxProto::GetToxOptions() return options; } -bool CToxProto::InitToxCore() +bool CToxProto::InitToxCore(CToxThread *toxThread) { logger->Log(__FUNCTION__": initializing tox core"); + if (toxThread == NULL) + return false; + Tox_Options *options = GetToxOptions(); if (options == NULL) return false; if (LoadToxProfile(options)) { - if (toxThread == NULL) { - tox_options_free(options); - return false; - } - TOX_ERR_NEW initError; toxThread->tox = tox_new(options, &initError); if (initError != TOX_ERR_NEW_OK) @@ -117,7 +115,7 @@ bool CToxProto::InitToxCore() return false; } -void CToxProto::UninitToxCore() +void CToxProto::UninitToxCore(CToxThread *toxThread) { if (toxThread) { if (toxThread->toxAv) @@ -130,6 +128,7 @@ void CToxProto::UninitToxCore() SaveToxProfile(); tox_kill(toxThread->tox); + toxThread->tox = NULL; } toxThread = NULL; } -- cgit v1.2.3