Fixes memory leak.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-10-23 18:38:12 +02:00
parent 51897e42da
commit 7354c835e6
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ namespace CreatureLib::Battling {
bool _hasEnded = false; bool _hasEnded = false;
BattleResult _battleResult = BattleResult::Empty(); BattleResult _battleResult = BattleResult::Empty();
EventHook _eventHook; EventHook _eventHook;
HistoryHolder* _historyHolder = new HistoryHolder(); ArbUt::UniquePtr<HistoryHolder> _historyHolder = new HistoryHolder();
uint32_t _currentTurn = 0; uint32_t _currentTurn = 0;
@ -115,7 +115,7 @@ namespace CreatureLib::Battling {
try_creature(this->_historyHolder->Register<T>(this->GetCurrentTurn(), args...); try_creature(this->_historyHolder->Register<T>(this->GetCurrentTurn(), args...);
, "Exception occurred during history element registration."); , "Exception occurred during history element registration.");
} }
const HistoryHolder* GetHistory() const noexcept { return _historyHolder; } const HistoryHolder* GetHistory() const noexcept { return _historyHolder.GetRaw(); }
long GetLastTurnTimeMicroseconds() const noexcept { return _lastTurnTime; } long GetLastTurnTimeMicroseconds() const noexcept { return _lastTurnTime; }