Commit 923b1300 authored by Marius Bozga's avatar Marius Bozga
Browse files

fix memory leaks for event/labels

parent 12917c18
......@@ -448,7 +448,7 @@ void IfDfsExplorator::run(IfConfig* start) {
tt->tail = st;
tt->pending = NULL;
tt->state = su->state;
tt->label = su->label;
tt->label = su->label->copy();
tt->state->setMark((q_count++) | REACHED | STACKED);
dfs.depth++;
......@@ -492,7 +492,7 @@ try {
visit(st->state, su->label, su->state);
st->pending = su->next;
//delete su->label;
delete su->label;
delete su;
t_count++;
......
......@@ -101,7 +101,7 @@ IfLabelHandler::~IfLabelHandler() {
int IfLabelHandler::trace(const IfEvent* event) {
int ok = 1;
if (m_length < LABELMAXSIZE - 1) {
m_label.setAt(m_length, event);
m_label.setAt(m_length, event->store());
m_tab[m_length] = m_version;
m_length++;
}
......
......@@ -299,14 +299,14 @@ class IfIterator : public IfEngine {
const char* value,
const if_pid_type auxPid = 0,
IfObject* auxObj = NULL)
{ IfEvent* event = new IfEvent(kind, pid, value, auxPid, auxObj);
return trace(event); }
{ IfEvent event(kind, pid, value, auxPid, auxObj);
return trace(&event); }
inline int trace(const IfEvent::Kind kind,
const if_pid_type pid,
const char* value,
const double proba)
{ IfEvent* event = new IfEvent(kind, pid, value, proba);
return trace(event); }
{ IfEvent event(kind, pid, value, proba);
return trace(&event); }
public:
inline int deliver(const if_pid_type pid,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment