only call deleteLater for linkedData if we have a QCoreApplication instance

This commit is contained in:
Stephen Birarda 2013-11-07 12:38:28 -08:00
parent eef6fd53eb
commit fe962e6be1
2 changed files with 4 additions and 6 deletions

View file

@ -12,9 +12,6 @@
#include <sys/time.h>
#include <sys/wait.h>
#include <QtCore/QCoreApplication>
#include <Logging.h>
#include <NodeList.h>
#include <PacketHeaders.h>
@ -41,8 +38,6 @@ int argc = 0;
char** argv = NULL;
void childClient() {
QCoreApplication application(::argc, ::argv);
// set the logging target to the the CHILD_TARGET_NAME
Logging::setTargetName(CHILD_TARGET_NAME);

View file

@ -21,6 +21,7 @@
#include "SharedUtil.h"
#include "UDPSocket.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
Node::Node(const QUuid& uuid, char type, sockaddr* publicSocket, sockaddr* localSocket) :
@ -43,8 +44,10 @@ Node::~Node() {
delete _publicSocket;
delete _localSocket;
if (_linkedData) {
if (QCoreApplication::instance()) {
_linkedData->deleteLater();
} else {
delete _linkedData;
}
delete _bytesReceivedMovingAverage;