| 1053 | } |
| 1054 | |
| 1055 | void 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 | |
| 1090 | void RadiantSelectionSystem::checkComponentModeSelectionMode(const ISelectable& selectable) |
| 1091 | { |
nothing calls this directly
no test coverage detected