Bazaar developer reference

CvDllHandicapInfo::DecrementReference()

Defined in
CvDllHandicapInfo.cpp, line 41
Class
CvDllHandicapInfo
Hook name
CivHooks::CvDllHandicapInfo_DecrementReference

Hooks

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

Code

41unsigned int CvDllHandicapInfo::DecrementReference()42{43	if(m_uiRefCount == 1)44	{45		delete this;46		return 0;47	}48	else49	{50		--m_uiRefCount;51		return m_uiRefCount;52	}53}

Called by