tweak shutdown

This commit is contained in:
ZappoMan 2014-03-31 16:51:00 -07:00
parent 7a683b177d
commit dc302e7126

View file

@ -48,6 +48,8 @@ OctreeQueryNode::~OctreeQueryNode() {
if (extraDebugging) { if (extraDebugging) {
qDebug() << "OctreeQueryNode::~OctreeQueryNode()"; qDebug() << "OctreeQueryNode::~OctreeQueryNode()";
} }
/*
if (_octreeSendThread) { if (_octreeSendThread) {
if (extraDebugging) { if (extraDebugging) {
qDebug() << "OctreeQueryNode::~OctreeQueryNode()... calling _octreeSendThread->terminate()"; qDebug() << "OctreeQueryNode::~OctreeQueryNode()... calling _octreeSendThread->terminate()";
@ -58,6 +60,7 @@ OctreeQueryNode::~OctreeQueryNode() {
} }
delete _octreeSendThread; delete _octreeSendThread;
} }
*/
delete[] _octreePacket; delete[] _octreePacket;
delete[] _lastOctreePacket; delete[] _lastOctreePacket;
@ -79,16 +82,20 @@ void OctreeQueryNode::nodeKilled() {
qDebug() << "OctreeQueryNode::nodeKilled()... "; qDebug() << "OctreeQueryNode::nodeKilled()... ";
_isShuttingDown = true; _isShuttingDown = true;
if (_octreeSendThread) { if (_octreeSendThread) {
qDebug() << "OctreeQueryNode::nodeKilled()... calling _octreeSendThread->terminate()";
_octreeSendThread->terminate();
qDebug() << "OctreeQueryNode::nodeKilled()... AFTER _octreeSendThread->terminate()";
OctreeSendThread* sendThread = _octreeSendThread; OctreeSendThread* sendThread = _octreeSendThread;
qDebug() << "OctreeQueryNode::nodeKilled()... calling _octreeSendThread = NULL"; qDebug() << "OctreeQueryNode::nodeKilled()... calling _octreeSendThread = NULL";
_octreeSendThread = NULL; _octreeSendThread = NULL;
qDebug() << "OctreeQueryNode::nodeKilled()... AFTER _octreeSendThread = NULL"; qDebug() << "OctreeQueryNode::nodeKilled()... AFTER _octreeSendThread = NULL";
qDebug() << "OctreeQueryNode::nodeKilled()... calling _octreeSendThread->setIsShuttingDown()";
sendThread->setIsShuttingDown();
qDebug() << "OctreeQueryNode::nodeKilled()... AFTER _octreeSendThread->setIsShuttingDown()";
qDebug() << "OctreeQueryNode::nodeKilled()... calling _octreeSendThread->terminate()";
sendThread->terminate();
qDebug() << "OctreeQueryNode::nodeKilled()... AFTER _octreeSendThread->terminate()";
qDebug() << "OctreeQueryNode::nodeKilled()... calling delete sendThread"; qDebug() << "OctreeQueryNode::nodeKilled()... calling delete sendThread";
delete sendThread; delete sendThread;
qDebug() << "OctreeQueryNode::nodeKilled()... AFTER delete sendThread"; qDebug() << "OctreeQueryNode::nodeKilled()... AFTER delete sendThread";