Skip to content

Commit

Permalink
fixup: initialize ref_count_ to 0 in units
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 20, 2014
1 parent 52c5bf4 commit 3774107
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/unit.cpp
Expand Up @@ -136,6 +136,7 @@ const std::string& unit::leader_crown()

// Copy constructor
unit::unit(const unit& o):
ref_count_(0),
cfg_(o.cfg_),
loc_(o.loc_),
advances_to_(o.advances_to_),
Expand Down Expand Up @@ -215,6 +216,7 @@ unit::unit(const unit& o):
}

unit::unit(const config &cfg, bool use_traits, const vconfig* vcfg) :
ref_count_(0),
cfg_(),
loc_(cfg["x"] - 1, cfg["y"] - 1),
advances_to_(),
Expand Down Expand Up @@ -512,6 +514,7 @@ void unit::clear_status_caches()

unit::unit(const unit_type &u_type, int side, bool real_unit,
unit_race::GENDER gender) :
ref_count_(0),
cfg_(),
loc_(),
advances_to_(),
Expand Down

0 comments on commit 3774107

Please sign in to comment.