summaryrefslogtreecommitdiff
path: root/protocols/Tox/src
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-11-04 15:06:58 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-11-04 15:06:58 +0000
commitebac750ead171387c039ef4c912de307af487425 (patch)
tree3e27c72a3401d89a293459195183cb2ac4224d4f /protocols/Tox/src
parent254c9c779a5d68b13710db21cc4d7f70b4c2eadc (diff)
Tox: one more crash fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@15679 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r--protocols/Tox/src/api_main.cpp3
-rw-r--r--protocols/Tox/src/tox_core.cpp7
2 files changed, 6 insertions, 4 deletions
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<int(*)(const Tox*)>(__FUNCTION__)(tox);
- tox = NULL;
+ CreateFunction<int(*)(Tox*)>(__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;
}