Bazaar developer reference

CvDllUnit::DecrementReference()

Defined in
CvDllUnit.cpp, line 45
Class
CvDllUnit
Hook name
CivHooks::CvDllUnit_DecrementReference

Hooks

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

Code

45unsigned int CvDllUnit::DecrementReference()46{47	if(m_uiRefCount == 1)48	{49		delete this;50		return 0;51	}52	else53	{54		--m_uiRefCount;55		return m_uiRefCount;56	}57}

Called by