Skip to content

Commit

Permalink
ShaderClipboard can clear itself after map is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 29, 2017
1 parent b58dede commit 93dff6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions radiant/map/Map.cpp
Expand Up @@ -48,7 +48,6 @@
#include "selection/algorithm/Primitives.h"
#include "selection/algorithm/Group.h"
#include "selection/algorithm/Transformation.h"
#include "selection/shaderclipboard/ShaderClipboard.h"
#include "modulesystem/ModuleRegistry.h"
#include "modulesystem/StaticModule.h"
#include "RenderableAasFile.h"
Expand Down Expand Up @@ -414,9 +413,6 @@ void Map::load(const std::string& filename) {
// Move the view to a start position
gotoStartPosition();

// Clear the shaderclipboard, the references are most probably invalid now
GlobalShaderClipboard().clear();

// Let the filtersystem update the filtered status of all instances
GlobalFilterSystem().update();

Expand Down
3 changes: 2 additions & 1 deletion radiant/selection/shaderclipboard/ShaderClipboard.cpp
Expand Up @@ -169,8 +169,9 @@ sigc::signal<void> ShaderClipboard::signal_sourceChanged() const

void ShaderClipboard::onMapEvent(IMap::MapEvent ev)
{
if (ev == IMap::MapUnloading)
if (ev == IMap::MapUnloading || ev == IMap::MapLoaded)
{
// Clear the shaderclipboard, the references are most probably invalid now
clear();
}
}
Expand Down

0 comments on commit 93dff6b

Please sign in to comment.