MMA 8-2012: Clear out and deallocate the CDPS. */
| 185 | |
| 186 | /* MMA 8-2012: Clear out and deallocate the CDPS. */ |
| 187 | void clear_CDPS(agent* thisAgent, slot* s) |
| 188 | { |
| 189 | |
| 190 | list* cond_current, *cond_old; |
| 191 | preference* pref; |
| 192 | |
| 193 | /* The CDPS should never exist on a top-level slot, so we do |
| 194 | * not need to worry about checking for DO_TOP_LEVEL_REF_CTS. */ |
| 195 | |
| 196 | cond_old = cond_current = s->CDPS; |
| 197 | s->CDPS = NIL; |
| 198 | for (; cond_current != NIL; cond_current = cond_current->rest) |
| 199 | { |
| 200 | pref = static_cast<preference*>(cond_current->first); |
| 201 | preference_remove_ref(thisAgent, pref); |
| 202 | } |
| 203 | free_list(thisAgent, cond_old); |
| 204 | |
| 205 | } |
| 206 | /* MMA 8-2012 end */ |
| 207 | |
| 208 | void remove_garbage_slots(agent* thisAgent) |
no test coverage detected