You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
345 B
C++
24 lines
345 B
C++
/* $Id$ */
|
|
|
|
/** @file countedobj.cpp Support for reference counted objects. */
|
|
|
|
#include "../stdafx.h"
|
|
|
|
#include "countedptr.hpp"
|
|
|
|
int32 SimpleCountedObject::AddRef()
|
|
{
|
|
return ++m_ref_cnt;
|
|
}
|
|
|
|
int32 SimpleCountedObject::Release()
|
|
{
|
|
int32 res = --m_ref_cnt;
|
|
assert(res >= 0);
|
|
if (res == 0) {
|
|
FinalRelease();
|
|
delete this;
|
|
}
|
|
return res;
|
|
}
|