diff --git a/src/proc/mobject/session/scope-path.cpp b/src/proc/mobject/session/scope-path.cpp index 2b8896c10..5a2c7291b 100644 --- a/src/proc/mobject/session/scope-path.cpp +++ b/src/proc/mobject/session/scope-path.cpp @@ -83,7 +83,8 @@ namespace session { * may cause an empty default session to be created. */ ScopePath::ScopePath () - : path_() + : refcount_(0) + , path_() { clear(); } @@ -100,7 +101,8 @@ namespace session { * can't be connected to the (implicit) root */ ScopePath::ScopePath (Scope const& leaf) - : path_() + : refcount_(0) + , path_() { if (!leaf.isValid()) return; // invalid leaf defines invalid path.... @@ -109,6 +111,12 @@ namespace session { } + ScopePath::~ScopePath() + { + WARN_IF (refcount_, "Destroying a scope path frame with ref-count=%u", refcount_); + } + + /** constant \em invalid path token. Created by locating an invalid scope */ const ScopePath ScopePath::INVALID = ScopePath(Scope()); diff --git a/src/proc/mobject/session/scope-path.hpp b/src/proc/mobject/session/scope-path.hpp index c0802db6d..a650ff2a4 100644 --- a/src/proc/mobject/session/scope-path.hpp +++ b/src/proc/mobject/session/scope-path.hpp @@ -110,6 +110,7 @@ namespace session { class ScopePath : public lib::BoolCheckable { + size_t refcount_; std::vector path_; typedef vector _VType; @@ -117,6 +118,7 @@ namespace session { typedef lib::RangeIter<_VIter> _IterType; public: + ~ScopePath (); ScopePath (); ScopePath (Scope const& leaf); @@ -127,6 +129,7 @@ namespace session { bool empty() const; size_t size() const; size_t length() const; + size_t ref_count()const; ////////////////////////////////////////TICKET #429 : diagnostic output to be added later /// Iteration is always ascending from leaf to root @@ -179,6 +182,13 @@ namespace session { } + inline size_t + ScopePath::ref_count() const + { + return refcount_; + } + + inline size_t ScopePath::length() const {