Bazaar developer reference

CvDllGame::DecrementReference()

Defined in
CvDllGame.cpp, line 54
Class
CvDllGame
Hook name
CivHooks::CvDllGame_DecrementReference

Hooks

static bool BeforeCvDllGame_DecrementReference(CvDllGame* self, unsigned int& result);static void AfterCvDllGame_DecrementReference(CvDllGame* self, unsigned int& result);static unsigned int ReplaceCvDllGame_DecrementReference(unsigned int (*original)(CvDllGame*), CvDllGame* self);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllGame_DecrementReference::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllGame_DecrementReference);host->RegisterHook(host->pluginIndex, CivHooks::CvDllGame_DecrementReference::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllGame_DecrementReference);host->RegisterHook(host->pluginIndex, CivHooks::CvDllGame_DecrementReference::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllGame_DecrementReference);

Code

54unsigned int CvDllGame::DecrementReference()55{56	if(m_uiRefCount == 1)57	{58		delete this;59		return 0;60	}61	else62	{63		--m_uiRefCount;64		return m_uiRefCount;65	}66}

Called by