performs cleanup operations when the database needs to be closed (end soar, manual close, etc)
| 3317 | |
| 3318 | // performs cleanup operations when the database needs to be closed (end soar, manual close, etc) |
| 3319 | void smem_close(agent* thisAgent) |
| 3320 | { |
| 3321 | if (thisAgent->smem_db->get_status() == soar_module::connected) |
| 3322 | { |
| 3323 | _smem_close_vars(thisAgent); |
| 3324 | |
| 3325 | // if lazy, commit |
| 3326 | if (thisAgent->smem_params->lazy_commit->get_value() == on) |
| 3327 | { |
| 3328 | thisAgent->smem_stmts->commit->execute(soar_module::op_reinit); |
| 3329 | } |
| 3330 | |
| 3331 | // de-allocate common statements |
| 3332 | delete thisAgent->smem_stmts; |
| 3333 | |
| 3334 | // close the database |
| 3335 | thisAgent->smem_db->disconnect(); |
| 3336 | } |
| 3337 | } |
| 3338 | |
| 3339 | void smem_reinit_cmd(agent* thisAgent) |
| 3340 | { |
no test coverage detected