Bazaar developer reference

CvDllTechInfo::DecrementReference()

Defined in
CvDllTechInfo.cpp, line 40
Class
CvDllTechInfo
Hook name
CivHooks::CvDllTechInfo_DecrementReference

Hooks

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

Code

40unsigned int CvDllTechInfo::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