diff --git a/panda/src/express/referenceCount.I b/panda/src/express/referenceCount.I index 0824ab38b1..439f318a63 100644 --- a/panda/src/express/referenceCount.I +++ b/panda/src/express/referenceCount.I @@ -38,7 +38,9 @@ TypeHandle RefCountObj::_type_handle; INLINE ReferenceCount:: ReferenceCount() { _ref_count = 0; +#ifndef NDEBUG MemoryUsage::record_pointer(this); +#endif } //////////////////////////////////////////////////////////////////// @@ -54,7 +56,9 @@ ReferenceCount() { INLINE ReferenceCount:: ReferenceCount(const ReferenceCount &) { _ref_count = 0; +#ifndef NDEBUG MemoryUsage::record_pointer(this); +#endif } //////////////////////////////////////////////////////////////////// @@ -91,7 +95,9 @@ operator = (const ReferenceCount &) { INLINE ReferenceCount:: ~ReferenceCount() { prepare_delete(); +#ifndef NDEBUG MemoryUsage::remove_pointer(this); +#endif } ////////////////////////////////////////////////////////////////////