Bazaar developer reference

CvDllMap::DecrementReference()

Defined in
CvDllMap.cpp, line 43
Class
CvDllMap
Hook name
CivHooks::CvDllMap_DecrementReference

Hooks

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

Code

43unsigned int CvDllMap::DecrementReference()44{45	if(m_uiRefCount == 1)46	{47		delete this;48		return 0;49	}50	else51	{52		--m_uiRefCount;53		return m_uiRefCount;54	}55}

Called by