| 99 | } |
| 100 | |
| 101 | AgentSML::~AgentSML() |
| 102 | { |
| 103 | ResetCaptureReplay(); |
| 104 | |
| 105 | // Register for the new INPUT_WME_GARBAGE_COLLECTED_CALLBACK |
| 106 | // Base the id on the address of this object which ensures it's unique |
| 107 | std::ostringstream callbackId; |
| 108 | callbackId << "id_0x" << this << "_evt_" << INPUT_WME_GARBAGE_COLLECTED_CALLBACK; |
| 109 | soar_remove_callback(GetSoarAgent(), INPUT_WME_GARBAGE_COLLECTED_CALLBACK, callbackId.str().c_str()) ; |
| 110 | |
| 111 | delete m_pAgentRunCallback ; |
| 112 | |
| 113 | /* RPM 9/06 added code from reinitialize_soar to clean up stuff hanging from last run |
| 114 | need to put it here instead of in destroy_soar_agent because gSKI is |
| 115 | cleaning up too much stuff and thus it will crash if called later */ |
| 116 | clear_goal_stack(m_agent); |
| 117 | m_agent->active_level = 0; /* Signal that everything should be retracted */ |
| 118 | m_agent->FIRING_TYPE = IE_PRODS; |
| 119 | do_preference_phase(m_agent); /* allow all i-instantiations to retract */ |
| 120 | |
| 121 | destroy_soar_agent(m_agent); |
| 122 | } |
| 123 | |
| 124 | // Release any objects or other data we are keeping. We do this just |
| 125 | // prior to deleting AgentSML, but before the underlying gSKI agent has been deleted |
nothing calls this directly
no test coverage detected