Bazaar developer reference

CvDllUnitInfo::DecrementReference()

Defined in
CvDllUnitInfo.cpp, line 40
Class
CvDllUnitInfo
Hook name
CivHooks::CvDllUnitInfo_DecrementReference

Hooks

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

Code

40unsigned int CvDllUnitInfo::DecrementReference()41{42	if(m_uiRefCount == 1)43	{44		delete this;45		return 0;46	}47	else48	{49		--m_uiRefCount;50		return m_uiRefCount;51	}52}

Called by