src/misc/countedobj.cpp
author skidd13
Mon, 02 Jun 2008 14:27:58 +0000
changeset 10809 5e1189c1df5c
parent 10429 1b99254f9607
permissions -rw-r--r--
(svn r13360) -Fix (r13359): Forgot to remove some instances of FiosAlloc()
/* $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;
}