Esempio n. 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;
}
Esempio n. 2
0
//=============================================================================
//Performs clean-up
//=============================================================================
void GLApp::CleanUp()
{
	eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
	
	if(m_pIShell)
	{
		ISHELL_Release(m_pIShell);
		m_pIShell = NULL;
	}

	if(m_pDBitmap) 
	{
		IBITMAP_Release(m_pDBitmap);
		m_pDBitmap = NULL;
	}

	if(m_eglContext)
	{
		eglDestroyContext(m_eglDisplay, m_eglContext);
		m_eglContext = NULL;
	}

	if(m_eglSurface)
	{
		eglDestroySurface(m_eglDisplay, m_eglSurface);
		m_eglSurface = NULL;
	}

	if(m_eglDisplay)
	{
		eglTerminate(m_eglDisplay);
		m_eglDisplay = NULL;
	}

	if(m_pIEGL) 
	{
		IEGL_Release(m_pIEGL);
		m_pIEGL = NULL;
	}

	if(m_pIGL) 
	{
		IGL_Release(m_pIGL);
		m_pIGL = NULL;
	}
}
// ================================================================================
// 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;
}
Esempio n. 4
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;
}
Esempio n. 5
0
static void Loc_Cancel( AEECallback *pcb )
{
   LocState *pts = (LocState *)pcb->pCancelData;

   if( TRUE == pts->bInNotification ) {
      /* It is not safe to cleanup from a notification. Defer it. */
      pts->bSetForCancellation = TRUE;
      return;
   }

   /* Kill any ongoing process */
   CALLBACK_Cancel( &pts->cbInfo );
   CALLBACK_Cancel( &pts->cbIntervalTimer );
   
   pts->pcbResp->pfnCancel = 0;
   pts->pcbResp->pCancelData = 0;

   IPOSDET_Release( pts->pPos );
   ISHELL_Release( pts->pShell );

   FREE( pts );
}