Dont delete events after triggering the event listener. Once they're in the event listeners hands, it's their responsibility to properly clean up the memory.
This commit is contained in:
@@ -20,7 +20,6 @@ namespace CreatureLib::Battling {
|
||||
for (auto listener : _listeners) {
|
||||
listener(eventData);
|
||||
}
|
||||
delete eventData;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user