Bazaar developer reference

CvDllPromotionInfo::DecrementReference()

Defined in
CvDllPromotionInfo.cpp, line 42
Class
CvDllPromotionInfo
Hook name
CivHooks::CvDllPromotionInfo_DecrementReference

Hooks

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

Code

42unsigned int CvDllPromotionInfo::DecrementReference()43{44	if(m_uiRefCount == 1)45	{46		delete this;47		return 0;48	}49	else50	{51		--m_uiRefCount;52		return m_uiRefCount;53	}54}

Called by