VgwSessionFreeFnc


Use the VgwSessionFreeFnc function to release resources, such as memory for data structures, acquired by your session. The Verity engine calls your VgwSessionFreeFnc function when the collection or document source is has been closed.


Syntax

VdkError VgwSessionFreeFnc(
   VgwAppSession   vgwSession)

Arguments

 


vgwSession

VgwAppSession   A reference to the handle created in your VgwSessionNewFnc callback function.


Returns

This function must return one of the following error codes:

VdkSuccess for success

 

VdkError_* for a standard Verity Developer Kit API error as described in the Verity Developer’s Kit Programming Reference

 

VdkFail for a non-specific error

 


Discussion

In addition to the Verity engine calling your VgwSessionFreeFnc function when the driver is no longer in use, you can call VgwSessionFreeFnc also; for example, if your VgwSessionNewFnc function results in an error, you may need to free resources allocated in VgwSessionNewFnc before terminating.

You should free your session data, referenced by vgwSession, after first releasing all other resources referenced by the session handle.


Example

static VdkError
VDK_CALLBACK VgwSessionFree(VgwAppSession pSession)
{
if (!pSession)
return VdkSuccess;

/********************************************
* free the appData created in VgwSessionNew
********************************************/

if (pSession->configDirectory)
free((void*)pSession->configDirectory);

free(pSession);
return VdkSuccess;
}