handle variable destroyed by garbage collector.

This commit is contained in:
Vítor Santos Costa 2011-06-03 12:54:09 +01:00
parent 56d71e55b4
commit b1a3b925ae

View File

@ -195,8 +195,11 @@ runSolver (void)
const ParamSet& beliefs = results[i]; const ParamSet& beliefs = results[i];
YAP_Term queryBeliefsL = YAP_TermNil(); YAP_Term queryBeliefsL = YAP_TermNil();
for (int j = beliefs.size() - 1; j >= 0; j--) { for (int j = beliefs.size() - 1; j >= 0; j--) {
YAP_Int sl1 = YAP_InitSlot(list);
YAP_Term belief = YAP_MkFloatTerm (beliefs[j]); YAP_Term belief = YAP_MkFloatTerm (beliefs[j]);
queryBeliefsL = YAP_MkPairTerm (belief, queryBeliefsL); queryBeliefsL = YAP_MkPairTerm (belief, queryBeliefsL);
list = YAP_GetFromSlot(sl1);
YAP_RecoverSlots(1);
} }
list = YAP_MkPairTerm (queryBeliefsL, list); list = YAP_MkPairTerm (queryBeliefsL, list);
} }