summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_core.cpp')
-rw-r--r--protocols/Tox/src/tox_core.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp
index 25e35c84dd..335743303b 100644
--- a/protocols/Tox/src/tox_core.cpp
+++ b/protocols/Tox/src/tox_core.cpp
@@ -119,17 +119,18 @@ bool CToxProto::InitToxCore()
void CToxProto::UninitToxCore()
{
- if (toxThread->toxAv)
- toxav_kill(toxThread->toxAv);
+ if (toxThread) {
+ if (toxThread->toxAv)
+ toxav_kill(toxThread->toxAv);
- if (toxThread->tox)
- {
- CancelAllTransfers();
+ if (toxThread->tox)
+ {
+ CancelAllTransfers();
- SaveToxProfile();
+ SaveToxProfile();
- tox_kill(toxThread->tox);
+ tox_kill(toxThread->tox);
+ }
+ toxThread = NULL;
}
-
- toxThread = NULL;
} \ No newline at end of file