mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:39:41 +02:00
Remove dangling packet sender pointer before it's invalid.
This commit is contained in:
parent
d67044f220
commit
4fd6eb559b
1 changed files with 8 additions and 1 deletions
|
@ -566,8 +566,15 @@ void EntityScriptServer::handleOctreePacket(QSharedPointer<ReceivedMessage> mess
|
||||||
void EntityScriptServer::aboutToFinish() {
|
void EntityScriptServer::aboutToFinish() {
|
||||||
shutdownScriptEngine();
|
shutdownScriptEngine();
|
||||||
|
|
||||||
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
// our entity tree is going to go away so tell that to the EntityScriptingInterface
|
// our entity tree is going to go away so tell that to the EntityScriptingInterface
|
||||||
DependencyManager::get<EntityScriptingInterface>()->setEntityTree(nullptr);
|
entityScriptingInterface->setEntityTree(nullptr);
|
||||||
|
|
||||||
|
// Should always be true as they are singletons.
|
||||||
|
if (entityScriptingInterface->getPacketSender() == &_entityEditSender) {
|
||||||
|
// The packet sender is about to go away.
|
||||||
|
entityScriptingInterface->setPacketSender(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
DependencyManager::get<ResourceManager>()->cleanup();
|
DependencyManager::get<ResourceManager>()->cleanup();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue