mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:43:25 +02:00
fix random crash on interface shutdown
This commit is contained in:
parent
d556581842
commit
bdcca9cbf4
6 changed files with 17 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
|||
|
||||
VoxelHideShowThread::VoxelHideShowThread(VoxelSystem* theSystem) :
|
||||
_theSystem(theSystem) {
|
||||
//qDebug() << "VoxelHideShowThread::VoxelHideShowThread() this=" << this;
|
||||
}
|
||||
|
||||
bool VoxelHideShowThread::process() {
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
JurisdictionListener::JurisdictionListener(NODE_TYPE type, PacketSenderNotify* notify) :
|
||||
_packetSender(notify, JurisdictionListener::DEFAULT_PACKETS_PER_SECOND)
|
||||
{
|
||||
//qDebug() << "JurisdictionListener::JurisdictionListener() this=" << this;
|
||||
//qDebug() << "JurisdictionListener::JurisdictionListener() this=" << this << " _packetSender=" << &_packetSender;
|
||||
|
||||
_nodeType = type;
|
||||
ReceivedPacketProcessor::_dontSleep = true; // we handle sleeping so this class doesn't need to
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ OctreePersistThread::OctreePersistThread(Octree* tree, const QString& filename,
|
|||
_persistInterval(persistInterval),
|
||||
_initialLoadComplete(false),
|
||||
_loadTimeUSecs(0) {
|
||||
//qDebug() << "OctreePersistThread::OctreePersistThread()... this=" << this;
|
||||
}
|
||||
|
||||
bool OctreePersistThread::process() {
|
||||
|
|
|
@ -17,10 +17,16 @@ GenericThread::GenericThread() :
|
|||
_stopThread(false),
|
||||
_isThreaded(false) // assume non-threaded, must call initialize()
|
||||
{
|
||||
//qDebug() << "GenericThread::GenericThread() this=" << this;
|
||||
}
|
||||
|
||||
GenericThread::~GenericThread() {
|
||||
terminate();
|
||||
//qDebug() << "GenericThread::~GenericThread() this=" << this;
|
||||
|
||||
// we only need to call terminate() if we're actually threaded and still running
|
||||
if (isStillRunning() && isThreaded()) {
|
||||
terminate();
|
||||
}
|
||||
}
|
||||
|
||||
void GenericThread::initialize(bool isThreaded) {
|
||||
|
@ -39,12 +45,14 @@ void GenericThread::initialize(bool isThreaded) {
|
|||
}
|
||||
|
||||
void GenericThread::terminate() {
|
||||
//qDebug() << "GenericThread::terminate()... this=" << this;
|
||||
if (_isThreaded) {
|
||||
_stopThread = true;
|
||||
|
||||
if (_thread) {
|
||||
_thread->wait();
|
||||
_thread->deleteLater();
|
||||
_thread = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,6 +74,7 @@ void GenericThread::threadRoutine() {
|
|||
|
||||
// If we were on a thread, then quit our thread
|
||||
if (_isThreaded && _thread) {
|
||||
//qDebug() << "GenericThread::threadRoutine()... about to call _thread->quit() this=" << this << " _thread=" << _thread;
|
||||
_thread->quit();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ PacketSender::PacketSender(PacketSenderNotify* notify, int packetsPerSecond) :
|
|||
_totalPacketsQueued(0),
|
||||
_totalBytesQueued(0)
|
||||
{
|
||||
//qDebug() << "PacketSender::PacketSender()... this=" << this;
|
||||
}
|
||||
|
||||
PacketSender::~PacketSender() {
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
ReceivedPacketProcessor::ReceivedPacketProcessor() {
|
||||
_dontSleep = false;
|
||||
//qDebug() << "ReceivedPacketProcessor::ReceivedPacketProcessor()... this=" << this;
|
||||
}
|
||||
|
||||
void ReceivedPacketProcessor::queueReceivedPacket(const HifiSockAddr& address, unsigned char* packetData, ssize_t packetLength) {
|
||||
|
|
Loading…
Reference in a new issue