mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:56:44 +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) :
|
VoxelHideShowThread::VoxelHideShowThread(VoxelSystem* theSystem) :
|
||||||
_theSystem(theSystem) {
|
_theSystem(theSystem) {
|
||||||
|
//qDebug() << "VoxelHideShowThread::VoxelHideShowThread() this=" << this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VoxelHideShowThread::process() {
|
bool VoxelHideShowThread::process() {
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
JurisdictionListener::JurisdictionListener(NODE_TYPE type, PacketSenderNotify* notify) :
|
JurisdictionListener::JurisdictionListener(NODE_TYPE type, PacketSenderNotify* notify) :
|
||||||
_packetSender(notify, JurisdictionListener::DEFAULT_PACKETS_PER_SECOND)
|
_packetSender(notify, JurisdictionListener::DEFAULT_PACKETS_PER_SECOND)
|
||||||
{
|
{
|
||||||
|
//qDebug() << "JurisdictionListener::JurisdictionListener() this=" << this;
|
||||||
|
//qDebug() << "JurisdictionListener::JurisdictionListener() this=" << this << " _packetSender=" << &_packetSender;
|
||||||
|
|
||||||
_nodeType = type;
|
_nodeType = type;
|
||||||
ReceivedPacketProcessor::_dontSleep = true; // we handle sleeping so this class doesn't need to
|
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),
|
_persistInterval(persistInterval),
|
||||||
_initialLoadComplete(false),
|
_initialLoadComplete(false),
|
||||||
_loadTimeUSecs(0) {
|
_loadTimeUSecs(0) {
|
||||||
|
//qDebug() << "OctreePersistThread::OctreePersistThread()... this=" << this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OctreePersistThread::process() {
|
bool OctreePersistThread::process() {
|
||||||
|
|
|
@ -17,10 +17,16 @@ GenericThread::GenericThread() :
|
||||||
_stopThread(false),
|
_stopThread(false),
|
||||||
_isThreaded(false) // assume non-threaded, must call initialize()
|
_isThreaded(false) // assume non-threaded, must call initialize()
|
||||||
{
|
{
|
||||||
|
//qDebug() << "GenericThread::GenericThread() this=" << this;
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericThread::~GenericThread() {
|
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) {
|
void GenericThread::initialize(bool isThreaded) {
|
||||||
|
@ -39,12 +45,14 @@ void GenericThread::initialize(bool isThreaded) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericThread::terminate() {
|
void GenericThread::terminate() {
|
||||||
|
//qDebug() << "GenericThread::terminate()... this=" << this;
|
||||||
if (_isThreaded) {
|
if (_isThreaded) {
|
||||||
_stopThread = true;
|
_stopThread = true;
|
||||||
|
|
||||||
if (_thread) {
|
if (_thread) {
|
||||||
_thread->wait();
|
_thread->wait();
|
||||||
_thread->deleteLater();
|
_thread->deleteLater();
|
||||||
|
_thread = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,6 +74,7 @@ void GenericThread::threadRoutine() {
|
||||||
|
|
||||||
// If we were on a thread, then quit our thread
|
// If we were on a thread, then quit our thread
|
||||||
if (_isThreaded && _thread) {
|
if (_isThreaded && _thread) {
|
||||||
|
//qDebug() << "GenericThread::threadRoutine()... about to call _thread->quit() this=" << this << " _thread=" << _thread;
|
||||||
_thread->quit();
|
_thread->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ PacketSender::PacketSender(PacketSenderNotify* notify, int packetsPerSecond) :
|
||||||
_totalPacketsQueued(0),
|
_totalPacketsQueued(0),
|
||||||
_totalBytesQueued(0)
|
_totalBytesQueued(0)
|
||||||
{
|
{
|
||||||
|
//qDebug() << "PacketSender::PacketSender()... this=" << this;
|
||||||
}
|
}
|
||||||
|
|
||||||
PacketSender::~PacketSender() {
|
PacketSender::~PacketSender() {
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
ReceivedPacketProcessor::ReceivedPacketProcessor() {
|
ReceivedPacketProcessor::ReceivedPacketProcessor() {
|
||||||
_dontSleep = false;
|
_dontSleep = false;
|
||||||
|
//qDebug() << "ReceivedPacketProcessor::ReceivedPacketProcessor()... this=" << this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceivedPacketProcessor::queueReceivedPacket(const HifiSockAddr& address, unsigned char* packetData, ssize_t packetLength) {
|
void ReceivedPacketProcessor::queueReceivedPacket(const HifiSockAddr& address, unsigned char* packetData, ssize_t packetLength) {
|
||||||
|
|
Loading…
Reference in a new issue