Skip to content

Commit

Permalink
Fixup EClassManager to not clear out entityDefs in unrealise(), since…
Browse files Browse the repository at this point in the history
… we might be reloading the defs.

Clear the EClassManager members in the shutdownModule() method instead.
  • Loading branch information
codereader committed Dec 10, 2017
1 parent 403fa66 commit 8dc14d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
14 changes: 11 additions & 3 deletions plugins/eclassmgr/EClassManager.cpp
Expand Up @@ -242,8 +242,6 @@ void EClassManager::unrealise()
{
// This waits for any threaded work to finish
_defLoader.reset();

_entityClasses.clear();
_realised = false;
}
}
Expand Down Expand Up @@ -317,8 +315,18 @@ void EClassManager::initialiseModule(const ApplicationContext& ctx)
void EClassManager::shutdownModule()
{
rMessage() << "EntityClassDoom3::shutdownModule called." << std::endl;
unrealise();

GlobalFileSystem().removeObserver(*this);

// Unrealise ourselves and wait for threads to finish
unrealise();

// Don't notify anyone anymore
_defsReloadedSignal.clear();

// Clear member structures
_entityClasses.clear();
_models.clear();
}

// This takes care of relading the entityDefs and refreshing the scenegraph
Expand Down
6 changes: 4 additions & 2 deletions plugins/shaders/Doom3ShaderSystem.cpp
Expand Up @@ -143,11 +143,13 @@ void Doom3ShaderSystem::ensureDefsLoaded()
}
}

void Doom3ShaderSystem::onFileSystemInitialise() {
void Doom3ShaderSystem::onFileSystemInitialise()
{
realise();
}

void Doom3ShaderSystem::onFileSystemShutdown() {
void Doom3ShaderSystem::onFileSystemShutdown()
{
unrealise();
}

Expand Down

0 comments on commit 8dc14d2

Please sign in to comment.