fix a leak in attack_prediction
This commit is contained in:
parent
71fe60ee43
commit
b4930b665a
2 changed files with 8 additions and 1 deletions
|
@ -276,6 +276,13 @@ battle_context::battle_context(const unit_stats &att, const unit_stats &def)
|
|||
defender_combatant_ = NULL;
|
||||
}
|
||||
|
||||
battle_context::~battle_context()
|
||||
{
|
||||
delete attacker_stats_;
|
||||
delete defender_stats_;
|
||||
delete attacker_combatant_;
|
||||
delete defender_combatant_;
|
||||
}
|
||||
battle_context& battle_context::operator=(const battle_context &other)
|
||||
{
|
||||
if (&other != this) {
|
||||
|
|
|
@ -108,7 +108,7 @@ public:
|
|||
battle_context(const unit_stats &att, const unit_stats &def);
|
||||
|
||||
battle_context(const battle_context &other);
|
||||
~battle_context() { delete attacker_stats_; delete defender_stats_; }
|
||||
~battle_context();
|
||||
|
||||
battle_context& operator=(const battle_context &other);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue