| 129 | } |
| 130 | |
| 131 | void DFHack::EventManager::unregisterAll(Plugin* plugin) { |
| 132 | DEBUG(log).print("unregistering all handlers for plugin {}\n", |
| 133 | plugin ? plugin->getName() : "<null>"); |
| 134 | for ( auto i = handlers[EventType::TICK].find(plugin); i != handlers[EventType::TICK].end(); i++ ) { |
| 135 | if ( (*i).first != plugin ) |
| 136 | break; |
| 137 | |
| 138 | removeFromTickQueue((*i).second); |
| 139 | } |
| 140 | for (auto &handler : handlers) { |
| 141 | handler.erase(plugin); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | static void manageTickEvent(color_ostream& out); |
| 146 | static void manageJobInitiatedEvent(color_ostream& out); |