Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

IFlip sample code, part 5

Definition and implementation of the c_iflipapp_FreeAppData() function

/*===========================================================================
FUNCTION c_iflipapp_FreeAppData

DESCRIPTION
	This function is called when your application is exiting.

PROTOTYPE:
	void c_iflipapp_FreeAppData(c_iflipapp* pMe)

PARAMETERS:
	pMe: Pointer to the c_iflipapp structure.

DEPENDENCIES
  none

RETURN VALUE
  none

SIDE EFFECTS
  none
===========================================================================*/

void c_iflipapp_FreeAppData(c_iflipapp* pMe)
{
   if (pMe->pIFlip != NULL)
   {
     IFLIP_Release(pMe->pIFlip);
	  pMe->pIFlip = NULL;
   }
   
   if(pMe->pDispList != NULL)
   {
     FREE(pMe->pDispList);
	  pMe->pDispList = NULL;
   }
   
   if (pMe->pIStatic != NULL)
   {
      ISTATIC_Release (pMe->pIStatic);
	  pMe->pIStatic = NULL;
   }
   
   if( pMe->pbuffer != NULL)
   {
      FREE(pMe->pbuffer);
	  pMe->pbuffer = NULL;
   }
   
   if( pMe->pOpenKeyList != NULL)
   {
      FREE(pMe->pOpenKeyList);
	  pMe->pOpenKeyList = NULL;
   }
   
   if( pMe->pCloseKeyList != NULL)
   {
      FREE(pMe->pCloseKeyList);
	  pMe->pCloseKeyList = NULL;
   }
   
   if( pMe->pAckFromBGapp != NULL)
   {
      FREE(pMe->pAckFromBGapp);
	  pMe->pAckFromBGapp = NULL;
   }

   {
      int i;
	  for (i=0; i < pMe-> nNumberOfDisplay; i++)	
	  {
	     if(pMe->pIDis[i] != NULL)
		 {
		    IDisplay_Release(pMe->pIDis[i]);
			pMe->pIDis[i] = NULL;
		 }
	  }

   }
   
   if( pMe->pIMedia != NULL)
   {
      IMEDIA_Release (pMe->pIMedia);
	  pMe->pIMedia = NULL;
   }
   
   if(pMe->pFlipInfoList != NULL)
   {
      FREE(pMe->pFlipInfoList);
	  pMe->pFlipInfoList = NULL;
   }
   
   if(pMe->pFlipInfoListOnFlipEvents != NULL)
   {
      FREE(pMe->pFlipInfoListOnFlipEvents);
	  pMe->pFlipInfoListOnFlipEvents = NULL;
   }
}