mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
only call deleteLater for linkedData if we have a QCoreApplication instance
This commit is contained in:
parent
eef6fd53eb
commit
fe962e6be1
2 changed files with 4 additions and 6 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue