1
0
Fork 0

free skiplist fields correctly

This commit is contained in:
Jan Steemann 2012-04-04 18:58:48 +02:00
parent cdf3d0e7e3
commit f01c18666f
1 changed files with 11 additions and 5 deletions

View File

@ -147,15 +147,21 @@ void ClearSLOperator(TRI_sl_operator_t* slOperator) {
case TRI_SL_LE_OPERATOR:
case TRI_SL_LT_OPERATOR:
{
size_t i;
relationOperator = (TRI_sl_relation_operator_t*)(slOperator);
if (relationOperator->_parameters != NULL) {
TRI_FreeJson(relationOperator->_parameters);
}
if (relationOperator->_fields) {
TRI_FreeShapedJson(relationOperator->_fields);
}
// relationOperator->_fields contains _numFields shapedJson objects
for (i = 0; i < relationOperator->_numFields; ++i) {
// destroy each individual shapedJson object
TRI_shaped_json_t* shaped = relationOperator->_fields + i;
TRI_DestroyShapedJson(shaped);
}
// free the memory pointer
TRI_Free(relationOperator->_fields);
TRI_Free(relationOperator);
break;
}