Skip to content

Commit

Permalink
unregister event listeners on disable
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Nov 5, 2023
1 parent f93bb60 commit f5d0c5b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/burrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) {
init_diggers(out);
EventManager::registerListener(EventManager::EventType::JOB_STARTED, EventManager::EventHandler(jobStartedHandler, 0), plugin_self);
EventManager::registerListener(EventManager::EventType::JOB_COMPLETED, EventManager::EventHandler(jobCompletedHandler, 0), plugin_self);
} else {
EventManager::unregisterAll(plugin_self);
}
}
else {
Expand Down

0 comments on commit f5d0c5b

Please sign in to comment.