diff options
Diffstat (limited to 'src/rc_string.cpp')
-rw-r--r-- | src/rc_string.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rc_string.cpp b/src/rc_string.cpp index 46f36923..4025d8c8 100644 --- a/src/rc_string.cpp +++ b/src/rc_string.cpp @@ -21,6 +21,18 @@ RcString::RcString(const char* s, unsigned int len): for(unsigned int j = 0; j < len; j ++ ) data_mut[j] = s[j]; data_mut[len] = '\0'; + + //::std::cout << "RcString(" << m_ptr << " \"" << *this << "\") - " << *m_ptr << " (creation)" << ::std::endl; + } +} +RcString::RcString(const RcString& x): + m_ptr(x.m_ptr), + m_len(x.m_len) +{ + if( m_ptr ) + { + *m_ptr += 1; + //::std::cout << "RcString(" << m_ptr << " \"" << *this << "\") - " << *m_ptr << " refs present (copy)" << ::std::endl; } } RcString::~RcString() @@ -28,7 +40,7 @@ RcString::~RcString() if(m_ptr) { *m_ptr -= 1; - //::std::cout << "RcString(\"" << *this << "\") - " << *m_ptr << " refs left" << ::std::endl; + //::std::cout << "RcString(" << m_ptr << " \"" << *this << "\") - " << *m_ptr << " refs left (drop)" << ::std::endl; if( *m_ptr == 0 ) { delete[] m_ptr; |