Bazaar developer reference

CvDllGameOptionInfo::DecrementReference()

Defined in
CvDllGameOptionInfo.cpp, line 41
Class
CvDllGameOptionInfo
Hook name
CivHooks::CvDllGameOptionInfo_DecrementReference

Hooks

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

Code

41unsigned int CvDllGameOptionInfo::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