summaryrefslogtreecommitdiff
path: root/src/sptr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sptr.h')
-rw-r--r--src/sptr.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sptr.h b/src/sptr.h
index e72644d..c95dad8 100644
--- a/src/sptr.h
+++ b/src/sptr.h
@@ -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;