Files @ r7922:d7c3cc15726d
Branch filter:

Location: cpp/openttd-patchpack/source/src/misc/countedobj.cpp

skidd13
(svn r11475) -Codechange: rename clamp and clampu to Clamp and ClampU to fit with the coding style
/* $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;
}