Skip to content

Commit

Permalink
fix(event): leak globalListen :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleeym committed Jan 13, 2025
1 parent 4fd9dd8 commit 7ac5d56
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions loader/include/Geode/loader/Event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ namespace geode {
// Creates an EventListener that is active for the entire lifetime of the game. You have no way of disabling the listener, so only use this if you want to always listen for certain events!
template <is_filter T>
void globalListen(typename T::Callback callback, T filter = T()) {
static std::vector<std::unique_ptr<EventListenerProtocol>> listeners;
listeners.push_back(std::make_unique<EventListener<T>>(EventListener<T> {callback, filter}));
new EventListener<T>({callback, filter});
}
}

0 comments on commit 7ac5d56

Please sign in to comment.