VgwGetSchemaFreeFnc


Use the VgwGetSchemaFreeFnc function to release resources, such as memory for data structures, acquired while creating your schema. The Verity engine calls your VgwGetSchemaFreeFnc function when the collection or document source has been closed.


Syntax

VdkError VgwGetSchemaFreeFnc(
   VgwSchema   schema)

Arguments

 


schema

VgwSchema   A schema handle returned from VgwGetSchema.


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 VgwGetSchemaFreeFnc function when the collection or document source associated with the repository is closed, you can call VgwGetSchemaFreeFnc directly; for example, if your VgwGetSchemaFnc function results in an error, you may need to free resources allocated in VgwGetSchemaFnc before terminating.

You should free the schema structure referenced by schema after first releasing all other resources.


Example

static VdkError
VDK_CALLBACK VgwGetSchemaFree(VgwSchema pSchema)
{
if (!pSchema)
return VdkSuccess;

/*******************************************
* no need to free static field column info
*******************************************/

if (pSchema->columnArray)
free(pSchema->columnArray);

/*********************************************************
* free the gateway schema object created in VgwGetSchema
*********************************************************/

free(pSchema);
return VdkSuccess;
}