Files @ r7867:0bf0e5c09438
Branch filter:

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

belugas
(svn r11417) -Fix[FS#1421]: Let the main viewport stay where the vehicle was last seen while been center-followed
/* $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;
}