The termination point of the addon.
GSErrCode FreeData ( void );
Return Values
NoError
- The function has completed with success.
Remarks
You can use this function as the termination point of your code. It is called right before the DLL/code fragment is to be unloaded from the memory.
This is the place where you can free your dynamic memory blocks, and unload the loaded modules.
This function will be called in conjunction with the Initialize function. You can be sure that the FreeData
function will be called only if this function was called before, even if any error code returned in the Initialize or the different callback functions.
If your add-on has user interface, and you want to use a context sensitive help engine (you want to use not just tooltips, but help anchors too), and you registered your own help engine’s path with your add-on’s MDID in the Initialize function, then you should uninitialize this data here.
In some exceptional cases the application terminates without calling the
FreeData
function of the add-ons. In these situations the system unloads the add-on modules. If you need to be called to handle these abnormal termination cases, set an APIDllTermHookProc with the ACAPI_SetDllTermHookProc function.
Example
GSErrCode __ACENV_CALL FreeData (void) { BMhFree ((GSHandle) handle); // If you used RegisterAdditionalHelpLocation in Initialize function DG::UnregisterAdditionalHelpLocation (MDID_APICD, MDID_APICD_InterfaceFunctions); return NoError; }
Requirements
- Version: API 1.3 or later
- Header: ACAPinc.h
See Also
Required Functions, Initialize
ACAPI_SetDllTermHookProc, APIDllTermHookProc
DGUnregisterAdditionalHelpLocation
API Functions