src/misc/countedobj.cpp
author rubidium
Mon, 31 Mar 2008 22:09:27 +0000
branch0.6
changeset 9357 bafe57f3402a
parent 7793 3c51623097fe
child 10429 1b99254f9607
permissions -rw-r--r--
(svn r12524) [0.6] -Update: some documentation.
/* $Id$ */

#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;
}