Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wesnoth/wesnoth
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 committed Jun 19, 2014
2 parents bde0a3a + 11bd01b commit ad7cf13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/unit.cpp
Expand Up @@ -79,11 +79,19 @@ namespace {

void intrusive_ptr_add_ref(const unit * u)
{
if(u->ref_count_ > 1000 || u->ref_count_ < 0)
{
WRN_UT << "found very much references: " << u->ref_count_ << " of them " << std::endl;
}
++(u->ref_count_);
}

void intrusive_ptr_release(const unit * u)
{
if(u->ref_count_ > 1000 || u->ref_count_ < 0)
{
WRN_UT << "found very much references: " << u->ref_count_ << " of them " << std::endl;
}
if (--(u->ref_count_) == 0)
delete u;
}
Expand Down

0 comments on commit ad7cf13

Please sign in to comment.