Пример #1
0
/*===========================================================================

Function:  AEEMod_Release()

Description:
   This function decreases the referecne count for the IModule object. If
   the reference count reaches zero, it does the required cleanup

Prototype:
   uint32 AEEMod_Release(IModule *po)

Parameters:
   po: Pointer to the IModule interface whose reference count needs to be
     decremented.

Return Value:
   The updated reference count

Comments:  None

Side Effects: None

==============================================================================*/
static uint32 AEEMod_Release(IModule *po)
{
   AEEMod *pMe = (AEEMod *)po;

   if (--pMe->m_nRefs != 0) {
      return pMe->m_nRefs;
   }

   // Ref count is zero. So, release memory associated with this object.


   // First, release user-specific data if any
   // Invoke User's FreeData function if they have registered
   if (pMe->pfnModFreeData) {
      pMe->pfnModFreeData(po);
   }
   if (pMe->m_pIShell) {
      ISHELL_Release(pMe->m_pIShell);
      pMe->m_pIShell = NULL;
   }

   //Free the object itself
   FREE_VTBL(pMe, IModule);
   FREE(pMe);
  
   return 0;
}
Пример #2
0
// ================================================================================
// FUNCTION		: SyncEngExt_Release
// DESCRIPTION	: This function decreases the reference count for the SyncEngExt object. If
//				: the reference count reaches zero, it does the required cleanup
// ================================================================================
static uint32 SyncEngExt_Release(ISyncEngExt * po)
{
	SyncEngExt *		pMe = (SyncEngExt *)po;

	//release member variable data
	if ( NULL!=pMe->m_pContHandler ) delete pMe->m_pContHandler;

	if( --pMe->m_nRefs != 0 )
		return pMe->m_nRefs;

	// Ref count is zero. So, release memory associated with this object.

	// Release interfaces
	ISHELL_Release(pMe->m_pIShell);
	IMODULE_Release(pMe->m_pIModule);
	//Free the object itself
	FREE_VTBL(pMe, IModule);
	FREE( pMe );

	return 0;
}
Пример #3
0
static uint32 AEEMod_Release(IModule *po)
{
   AEEMod *pMe = (AEEMod *)po;

   if (--pMe->m_nRefs != 0) {
      return pMe->m_nRefs;
   }
   if (pMe->pfnModFreeData) {
      pMe->pfnModFreeData(po);
   }
   if (pMe->m_pIShell) {
      ISHELL_Release(pMe->m_pIShell);
      pMe->m_pIShell = NULL;
   }

   //Free the object itself
   FREE_VTBL(pMe, IModule);
   FREE(pMe);
  
   return 0;
}