Bazaar developer reference

CvDllRandom::DecrementReference()

Defined in
CvDllRandom.cpp, line 44
Class
CvDllRandom
Hook name
CivHooks::CvDllRandom_DecrementReference

Hooks

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

Code

44unsigned int CvDllRandom::DecrementReference()45{46	if(m_uiRefCount == 1)47	{48		delete this;49		return 0;50	}51	else52	{53		--m_uiRefCount;54		return m_uiRefCount;55	}56}

Called by