Files @ r9740:4e610d6d0275
Branch filter:

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

belugas
(svn r13873) -Codechange: remove useless string from all language files affected by r13872. which removed the STR_NEWS_OPEN_CLOSE string
/* $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;
}