From 85fcdd765312b066e368a4d3adcfa901b1059c0a Mon Sep 17 00:00:00 2001 From: Dubslow Date: Wed, 3 Dec 2014 18:52:10 -0600 Subject: [PATCH] Fix not setting tox null after cleanup also reordered functions for super extra safety --- src/core.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 8cb27e8a8..05ce62261 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -90,9 +90,15 @@ Core::Core(Camera* cam, QThread *CoreThread, QString loadPath) : Core::~Core() { - if (tox) { + clearPassword(Core::ptMain); + clearPassword(Core::ptHistory); + + if (tox) + { toxav_kill(toxav); + toxav = nullptr; tox_kill(tox); + tox = nullptr; } if (videobuf) @@ -103,9 +109,6 @@ Core::~Core() Audio::closeInput(); Audio::closeOutput(); - - clearPassword(Core::ptMain); - clearPassword(Core::ptHistory); } Core* Core::getInstance()