Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 1 file). Show all
Unified · Split
| @@ -24,6 +24,7 @@ · 23 unmodified lines | |||
| 24 | #include <plugins/CodecPlugin.h> | 24 | #include <plugins/CodecPlugin.h> |
| 25 | #include <plugins/PluginManager.h> | 25 | #include <plugins/PluginManager.h> |
| 26 | #include <ResourceManager.h> | 26 | #include <ResourceManager.h> |
| 27 | #include <ResourceScriptingInterface.h> | ||
| 27 | #include <ScriptCache.h> | 28 | #include <ScriptCache.h> |
| 28 | #include <ScriptEngines.h> | 29 | #include <ScriptEngines.h> |
| 29 | #include <SoundCacheScriptingInterface.h> | 30 | #include <SoundCacheScriptingInterface.h> |
| @@ -55,7 +56,8 @@ int EntityScriptServer::_entitiesScriptEngineCount = 0; · 25 unmodified lines | |||
| 55 | EntityScriptServer::EntityScriptServer(ReceivedMessage& message) : ThreadedAssignment(message) { | 56 | EntityScriptServer::EntityScriptServer(ReceivedMessage& message) : ThreadedAssignment(message) { |
| 56 | qInstallMessageHandler(messageHandler); | 57 | qInstallMessageHandler(messageHandler); |
| 57 | 58 | ||
| 58 | DependencyManager::get<EntityScriptingInterface>()->setPacketSender(&_entityEditSender); | 59 | DependencyManager::set<EntityScriptingInterface>(false)->setPacketSender(&_entityEditSender); |
| 60 | DependencyManager::set<ResourceScriptingInterface>(); | ||
| 59 | 61 | ||
| 60 | DependencyManager::set<ResourceManager>(); | 62 | DependencyManager::set<ResourceManager>(); |
| 61 | DependencyManager::set<PluginManager>(); | 63 | DependencyManager::set<PluginManager>(); |
| @@ -559,14 +561,16 @@ void EntityScriptServer::handleOctreePacket(QSharedPointer<ReceivedMessage> mess · 497 unmodified lines | |||
| 559 | void EntityScriptServer::aboutToFinish() { | 561 | void EntityScriptServer::aboutToFinish() { |
| 560 | shutdownScriptEngine(); | 562 | shutdownScriptEngine(); |
| 561 | 563 | ||
| 562 | auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>(); | 564 | { |
| 563 | // our entity tree is going to go away so tell that to the EntityScriptingInterface | 565 | auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>(); |
| 564 | entityScriptingInterface->setEntityTree(nullptr); | 566 | // our entity tree is going to go away so tell that to the EntityScriptingInterface |
| 565 | 567 | entityScriptingInterface->setEntityTree(nullptr); | |
| 566 | // Should always be true as they are singletons. | 568 | |
| 567 | if (entityScriptingInterface->getPacketSender() == &_entityEditSender) { | 569 | // Should always be true as they are singletons. |
| 568 | // The packet sender is about to go away. | 570 | if (entityScriptingInterface->getPacketSender() == &_entityEditSender) { |
| 569 | entityScriptingInterface->setPacketSender(nullptr); | 571 | // The packet sender is about to go away. |
| 572 | entityScriptingInterface->setPacketSender(nullptr); | ||
| 573 | } | ||
| 570 | } | 574 | } |
| 571 | 575 | ||
| 572 | DependencyManager::destroy<AssignmentParentFinder>(); | 576 | DependencyManager::destroy<AssignmentParentFinder>(); |
| @@ -575,8 +579,12 @@ void EntityScriptServer::aboutToFinish() { · 2 unmodified lines | |||
| 575 | 579 | ||
| 576 | DependencyManager::destroy<PluginManager>(); | 580 | DependencyManager::destroy<PluginManager>(); |
| 577 | 581 | ||
| 582 | DependencyManager::destroy<ResourceScriptingInterface>(); | ||
| 583 | DependencyManager::destroy<EntityScriptingInterface>(); | ||
| 584 | |||
| 578 | // cleanup the AudioInjectorManager (and any still running injectors) | 585 | // cleanup the AudioInjectorManager (and any still running injectors) |
| 579 | DependencyManager::destroy<AudioInjectorManager>(); | 586 | DependencyManager::destroy<AudioInjectorManager>(); |
| 587 | |||
| 580 | DependencyManager::destroy<ScriptEngines>(); | 588 | DependencyManager::destroy<ScriptEngines>(); |
| 581 | DependencyManager::destroy<EntityScriptServerServices>(); | 589 | DependencyManager::destroy<EntityScriptServerServices>(); |
| 582 | 590 | ||