From 11bd01b91aefd8b0630ccd558dfd2a35cbec9c05 Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Fri, 20 Jun 2014 01:30:07 +0200 Subject: [PATCH] added test checks in intrusive_ptr_add_ref/release --- src/unit.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/unit.cpp b/src/unit.cpp index cdb10a0bc34..e36012a2eeb 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -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; }