Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi all,

Can someone explain what would be advantage of defining a global cleanup method vs. handling resource releases inside EVT_APP_STOP event?

To be more precise: when creating an instance of an applet in AEEClsCreateInstance(), AEEApplet_New() method can take an address of a clean-up method (last parameter) Quote:pFreeAppdata: [in]: Function pointer to the App's function to free the app data. This function will be invoked when the reference count of the app reaches zero. The app must free all its dynamically allocated data inside this function. That way defined global method is invoked from AEEApplet_Release() when reference count of an applet goes down to zero.
Is that prefered method of releasing resources (menus, etc...) vs. releasing them inside EVT_APP_STOP event handler? Why? Thank you.

As far I know it is recommended that your applet should register a PFNFREEAPPDATA type cleanup function as a last parameter. One of the reason might be EVT_APP_STOP event is not sent to applet unless applet starts itself.
regards
ruben

As far I know it is recommended that your applet should register a PFNFREEAPPDATA type cleanup function as a last parameter. One of the reason might be EVT_APP_STOP event is not sent to applet unless applet starts itself.
regards
ruben