Calling “Free” Functions

The “free” functions are functions ending in Free, which are called by the gateway when an object is no longer needed. A “free” function typically contains cleanup code. You should implement “free” functions so that if an error occurs when creating an object, you can perform cleanup by calling its corresponding “free” function explicitly.

The following table identifies object creation functions and their corresponding “free” functions:

 


Function

Corresponding “free” function

VgwSessionNew

VgwSessionFree

VgwSessionGetInfo

VgwSessionGetInfoFree

VgwDocSetNew

VgwDocSetFree

VgwDocSetRead

VgwDocSetReadFree

VgwDocFieldRead

VgwDocFieldReadFree

VgwStreamNew

VgwStreamFree

VgwGetSchema

VgwGetSchemaFree

VgwAuthenticate

VgwAuthenticateFree