mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
fixed crash on shutdown with multiple scripts
This commit is contained in:
parent
9d841ce918
commit
dbd6cb71c9
2 changed files with 12 additions and 2 deletions
|
@ -11,13 +11,19 @@
|
|||
#include "OctreeScriptingInterface.h"
|
||||
|
||||
OctreeScriptingInterface::OctreeScriptingInterface(OctreeEditPacketSender* packetSender,
|
||||
JurisdictionListener* jurisdictionListener)
|
||||
JurisdictionListener* jurisdictionListener) :
|
||||
_packetSender(NULL),
|
||||
_jurisdictionListener(NULL),
|
||||
_managedPacketSender(false),
|
||||
_managedJurisdictionListener(false),
|
||||
_initialized(false)
|
||||
{
|
||||
setPacketSender(packetSender);
|
||||
setJurisdictionListener(jurisdictionListener);
|
||||
}
|
||||
|
||||
OctreeScriptingInterface::~OctreeScriptingInterface() {
|
||||
qDebug() << "OctreeScriptingInterface::~OctreeScriptingInterface() this=" << this;
|
||||
cleanupManagedObjects();
|
||||
}
|
||||
|
||||
|
@ -45,6 +51,9 @@ void OctreeScriptingInterface::setJurisdictionListener(JurisdictionListener* jur
|
|||
}
|
||||
|
||||
void OctreeScriptingInterface::init() {
|
||||
if (_initialized) {
|
||||
return;
|
||||
}
|
||||
if (_jurisdictionListener) {
|
||||
_managedJurisdictionListener = false;
|
||||
} else {
|
||||
|
@ -64,5 +73,5 @@ void OctreeScriptingInterface::init() {
|
|||
if (QCoreApplication::instance()) {
|
||||
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(cleanupManagedObjects()));
|
||||
}
|
||||
|
||||
_initialized = true;
|
||||
}
|
||||
|
|
|
@ -93,6 +93,7 @@ protected:
|
|||
JurisdictionListener* _jurisdictionListener;
|
||||
bool _managedPacketSender;
|
||||
bool _managedJurisdictionListener;
|
||||
bool _initialized;
|
||||
};
|
||||
|
||||
#endif /* defined(__hifi__OctreeScriptingInterface__) */
|
||||
|
|
Loading…
Reference in a new issue