MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / ~KeyObserverMap

Method ~KeyObserverMap

radiantcore/entity/KeyObserverMap.h:92–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 }
91
92 ~KeyObserverMap()
93 {
94 // Detach each individual KeyObserver from its EntityKeyValue, to avoid
95 // dangling pointers if KeyObservers are destroyed.
96 for (auto& [key, observer]: _keyObservers)
97 detachObserver(key, *observer, false /* don't send final value change */);
98
99 // All observers are detached, clear them out
100 _keyObservers.clear();
101
102 // Clear out and destroy all signals
103 _keySignals.clear();
104
105 // Remove ourselves as an Entity::Observer (onKeyInsert and onKeyErase)
106 _entity.detachObserver(this);
107 }
108
109 /**
110 * @brief Add an observer slot for the specified key.

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
detachObserverMethod · 0.45

Tested by

no test coverage detected