Bazaar developer reference

CvDllTeam::DecrementReference()

Defined in
CvDllTeam.cpp, line 40
Class
CvDllTeam
Hook name
CivHooks::CvDllTeam_DecrementReference

Hooks

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

Code

40unsigned int CvDllTeam::DecrementReference()41{42	if(m_uiRefCount == 1)43	{44		delete this;45		return 0;46	}47	else48	{49		--m_uiRefCount;50		return m_uiRefCount;51	}52}

Called by