From dcf9d7f1d86a4de752be7adca37b0d6fe545be6a Mon Sep 17 00:00:00 2001 From: rich_sposato Date: Wed, 7 Mar 2007 00:28:17 +0000 Subject: [PATCH] Fixed bug 1668356 by making dtor inline and empty, and changing StrongPtr dtor. git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@818 7ec92016-0320-0410-acc4-a06ded1c099a --- include/loki/StrongPtr.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/loki/StrongPtr.h b/include/loki/StrongPtr.h index b0943e9..9cb076a 100644 --- a/include/loki/StrongPtr.h +++ b/include/loki/StrongPtr.h @@ -561,7 +561,11 @@ protected: Increment( strong ); } - ~TwoRefCounts( void ); + /** The destructor does not need to do anything since the call to + ZapPointer inside StrongPtr::~StrongPtr will do the cleanup which + this dtor would have done. + */ + inline ~TwoRefCounts( void ) {} inline bool Release( bool strong ) { @@ -657,6 +661,12 @@ protected: Increment( strong ); } + /** The destructor does not need to do anything since the call to + ZapPointer inside StrongPtr::~StrongPtr will do the cleanup which + this dtor would have done. + */ + inline ~LockableTwoRefCounts( void ) {} + inline void Lock( void ) const { m_counts->Lock(); @@ -1009,9 +1019,9 @@ public: // undefined behavior. Therefore, this must get pointer before // zapping it, and then delete the temp pointer. T * p = GetPointer(); + OP::ZapPointer(); if ( p != 0 ) { - OP::ZapPointer(); DP::Delete( p ); } }