Files @ r8575:68e9cd8ed4a9
Branch filter:

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

smatz
(svn r12156) -Fix (r11454): Chance16I was now biased towards zero - round to nearest now
/* $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;
}