diff options
Diffstat (limited to '')
-rw-r--r-- | src/sptr.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -23,7 +23,8 @@ public: | |||
23 | pRefCnt( src.pRefCnt ), | 23 | pRefCnt( src.pRefCnt ), |
24 | pData( src.pData ) | 24 | pData( src.pData ) |
25 | { | 25 | { |
26 | (*pRefCnt) += 1; | 26 | if( pRefCnt ) |
27 | (*pRefCnt) += 1; | ||
27 | } | 28 | } |
28 | 29 | ||
29 | SPtr( T *pSrc ) : | 30 | SPtr( T *pSrc ) : |
@@ -80,6 +81,7 @@ private: | |||
80 | if( pRefCnt ) | 81 | if( pRefCnt ) |
81 | { | 82 | { |
82 | (*pRefCnt) -= 1; | 83 | (*pRefCnt) -= 1; |
84 | printf("Decrementing ref-count to %d\n", *pRefCnt ); | ||
83 | if( (*pRefCnt) == 0 ) | 85 | if( (*pRefCnt) == 0 ) |
84 | { | 86 | { |
85 | delete pRefCnt; | 87 | delete pRefCnt; |