summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_core.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-09-14 19:34:42 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-09-14 19:34:42 +0000
commitdda141f0798b79cfa71e78934ed1b968fcc20f53 (patch)
tree327942389d763f66201e47d49ad3253e0c0fe1d1 /protocols/Tox/src/tox_core.cpp
parent98a324d2fb4babc09e94a10fef819f3409477eb2 (diff)
Tox: fixed tox thread management
git-svn-id: http://svn.miranda-ng.org/main/trunk@15354 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_core.cpp')
-rw-r--r--protocols/Tox/src/tox_core.cpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp
index 929c0c2536..225e04b7df 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(ToxThreadData *toxThread)
+bool CToxProto::InitToxCore(CToxThread *toxThread)
{
logger->Log(__FUNCTION__": initializing tox core");
@@ -112,34 +112,18 @@ bool CToxProto::InitToxCore(ToxThreadData *toxThread)
return false;
}
-void CToxProto::UninitToxCore(ToxThreadData *toxThread)
+void CToxProto::UninitToxCore()
{
+ if (toxThread->toxAv)
+ toxav_kill(toxThread->toxAv);
+
if (toxThread->tox)
{
- for (size_t i = 0; i < transfers.Count(); i++)
- {
- FileTransferParam *transfer = transfers.GetAt(i);
- tox_file_control(toxThread->tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, NULL);
- ProtoBroadcastAck(transfer->pfts.hContact, ACKTYPE_FILE, ACKRESULT_DENIED, (HANDLE)transfer, 0);
- transfers.Remove(transfer);
- }
-
- //if (IsToxCoreInited())
- //{
- // ptrA nickname(mir_utf8encodeW(ptrT(getTStringA("Nick"))));
- // tox_set_name(tox, (uint8_t*)(char*)nickname, mir_strlen(nickname));
-
- // //temporary
- // ptrA statusmes(mir_utf8encodeW(ptrT(getTStringA("StatusMsg"))));
- // tox_set_status_message(tox, (uint8_t*)(char*)statusmes, mir_strlen(statusmes));
- //}
-
- if (toxThread->toxAv)
- toxav_kill(toxThread->toxAv);
+ CancelAllTransfers();
SaveToxProfile();
tox_kill(toxThread->tox);
- toxThread = NULL;
+ this->toxThread = NULL;
}
} \ No newline at end of file