From 1d24eb14b487588ddc30b333924246a754a6e3e8 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 f162f59b6..fee037b68 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()