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:
parent
df0eca1716
commit
3e8f9340f3
|
@ -20,7 +20,6 @@ namespace CreatureLib::Battling {
|
||||||
for (auto listener : _listeners) {
|
for (auto listener : _listeners) {
|
||||||
listener(eventData);
|
listener(eventData);
|
||||||
}
|
}
|
||||||
delete eventData;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue