From dea2ccf0b79fe5760dff7c489d799c27d58e3d80 Mon Sep 17 00:00:00 2001 From: Dubslow Date: Fri, 23 Jan 2015 05:48:55 -0600 Subject: [PATCH] Fix segfault, minor cleanup --- src/core.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 56a6fb542..44b6c2e31 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -224,7 +224,6 @@ void Core::start() if (loadPath.isEmpty()) { qCritical() << "Core: loadConfiguration failed, exiting now"; - deadifyTox(); emit failedToStart(); return; } @@ -302,7 +301,7 @@ void Core::start() void Core::process() { - if (!tox) + if (!isReady()) return; static int tolerance = CORE_DISCONNECT_TOLERANCE; @@ -1004,7 +1003,7 @@ void Core::acceptFileRecvRequest(int friendId, int fileNum, QString path) void Core::removeFriend(int friendId, bool fake) { - if (!tox || fake) + if (!isReady() || fake) return; if (tox_del_friend(tox, friendId) == -1) { emit failedToRemoveFriend(friendId); @@ -1016,7 +1015,7 @@ void Core::removeFriend(int friendId, bool fake) void Core::removeGroup(int groupId, bool fake) { - if (!tox || fake) + if (!isReady() || fake) return; tox_del_groupchat(tox, groupId); @@ -1673,7 +1672,7 @@ QString Core::getPeerName(const ToxID& id) const bool Core::isReady() { - return ready; + return toxav && tox && ready; } void Core::setNospam(uint32_t nospam)