From ebac750ead171387c039ef4c912de307af487425 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 4 Nov 2015 15:06:58 +0000 Subject: Tox: one more crash fix git-svn-id: http://svn.miranda-ng.org/main/trunk@15679 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/api_main.cpp | 3 +-- protocols/Tox/src/tox_core.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'protocols/Tox') diff --git a/protocols/Tox/src/api_main.cpp b/protocols/Tox/src/api_main.cpp index cc46abcb63..5473c88f6f 100644 --- a/protocols/Tox/src/api_main.cpp +++ b/protocols/Tox/src/api_main.cpp @@ -19,8 +19,7 @@ Tox *tox_new(const struct Tox_Options *options, TOX_ERR_NEW *error) void tox_kill(Tox *tox) { - CreateFunction(__FUNCTION__)(tox); - tox = NULL; + CreateFunction(__FUNCTION__)(tox); } void tox_self_get_address(const Tox *tox, uint8_t *address) diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp index fd6452745a..bcc75eb436 100644 --- a/protocols/Tox/src/tox_core.cpp +++ b/protocols/Tox/src/tox_core.cpp @@ -128,8 +128,11 @@ void CToxProto::UninitToxCore(CToxThread *toxThread) SaveToxProfile(); - tox_kill(toxThread->tox); - toxThread->tox = NULL; + if (toxThread->tox != NULL) + { + tox_kill(toxThread->tox); + toxThread->tox = NULL; + } } toxThread = NULL; } -- cgit v1.2.3