added test checks in intrusive_ptr_add_ref/release

This commit is contained in:
gfgtdf 2014-06-20 01:30:07 +02:00
parent ebaea5812d
commit 11bd01b91a

View File

@ -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;
}