Added code to support test of bug 3224518.
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1096 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
9fe5e76c73
commit
cd6a4f5864
1 changed files with 16 additions and 8 deletions
|
@ -20,7 +20,7 @@
|
||||||
class BaseClass
|
class BaseClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseClass( void )
|
BaseClass( void ) : m_refCount( 1 )
|
||||||
{
|
{
|
||||||
s_constructions++;
|
s_constructions++;
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// These 2 functions are so we can pretend we have a COM object.
|
// These 2 functions are so we can pretend we have a COM object.
|
||||||
void AddRef( void ) {}
|
void AddRef( void ) { ++m_refCount; }
|
||||||
void Release( void ) {}
|
void Release( void )
|
||||||
|
{
|
||||||
|
assert( 0 < m_refCount );
|
||||||
|
--m_refCount;
|
||||||
|
if ( 0 == m_refCount )
|
||||||
|
delete this;
|
||||||
|
}
|
||||||
|
|
||||||
// This function is used only for the DeepCopy policy.
|
// This function is used only for the DeepCopy policy.
|
||||||
virtual BaseClass * Clone( void ) const
|
virtual BaseClass * Clone( void ) const
|
||||||
|
@ -75,6 +81,8 @@ private:
|
||||||
|
|
||||||
static unsigned int s_constructions;
|
static unsigned int s_constructions;
|
||||||
static unsigned int s_destructions;
|
static unsigned int s_destructions;
|
||||||
|
|
||||||
|
unsigned int m_refCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue