Bazaar developer reference

CvDllDeal::DecrementReference()

Defined in
CvDllDeal.cpp, line 41
Class
CvDllDeal
Hook name
CivHooks::CvDllDeal_DecrementReference

Hooks

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

Code

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