MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / shutdownModule

Method shutdownModule

radiantcore/selection/RadiantSelectionSystem.cpp:1055–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1053}
1054
1055void RadiantSelectionSystem::shutdownModule()
1056{
1057 _selectionFocusPool.clear();
1058
1059 // greebo: Unselect everything so that no references to scene::Nodes
1060 // are kept after shutdown, causing destruction issues.
1061 setSelectedAll(false);
1062 setSelectedAllComponents(false);
1063
1064 // In pathological cases this list might contain remnants. First, give each
1065 // selectable node a chance to remove itself from the container by setting
1066 // its own selected state to false (rather than waiting for this to happen
1067 // in its destructor).
1068 for (auto i = _selection.begin(); i != _selection.end(); )
1069 {
1070 // Take a reference to the node and increment the iterator while the
1071 // iterator is still valid.
1072 scene::INodePtr node = (i++)->first;
1073
1074 // If this is a selectable node, unselect it (which might remove it from
1075 // the map and invalidate the original iterator)
1076 auto selectable = scene::node_cast<ISelectable>(node);
1077 if (selectable)
1078 selectable->setSelected(false);
1079 }
1080
1081 // Clear the list of anything which remains.
1082 _selection.clear();
1083
1084 _activeManipulator.reset();
1085 _manipulators.clear();
1086
1087 GlobalRenderSystem().detachRenderable(*this);
1088}
1089
1090void RadiantSelectionSystem::checkComponentModeSelectionMode(const ISelectable& selectable)
1091{

Callers

nothing calls this directly

Calls 6

detachRenderableMethod · 0.80
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setSelectedMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected