Use the VgwDocFieldReadFreeFnc function to release resources, such as memory for data structures, acquired while reading external fields. The Verity engine calls your VgwDocFieldReadFreeFnc function after reading the fields.


VdkError VgwDocFieldReadFreeFnc(
VgwDataTable   dataTable)




VgwDataTable   A pointer to the structure that was created in your driver’s VgwDocFieldReadFnc callback function.


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



In addition to the Verity engine calling your VgwDocFieldReadFreeFnc function when the fields are no longer needed, you can call VgwDocFieldReadFreeFnc directly; for example, if your VgwDocFieldReadFnc function results in an error, you may need to free resources allocated in VgwDocFieldReadFnc before terminating.

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


static VdkError
VDK_CALLBACK VgwDocFieldReadFree(VgwDataTable pTable)
VdkUint4 i;
VdkUint2 j;

if (!pTable)
return VdkSuccess;

* free the data created in VgwDocFieldRead

if (pTable->values) {
for( i = 0; i < pTable->numRows; i++ )
for( j = 0; j < pTable->numColumns; j++ )
if(!(pTable->columnArray[j]->flags & VgwColumn_InLine))

return VdkSuccess;