Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug some memleaks in the new unit test
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 16 May 2017 18:19:26 +0000 (20:19 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 16 May 2017 18:19:42 +0000 (20:19 +0200)
src/surf/trace_mgr.cpp
src/surf/trace_mgr_test.cpp

index d8ea885..7fc1da1 100644 (file)
@@ -182,6 +182,7 @@ void tmgr_finalize()
     xbt_free((char*)kv.first);
     delete kv.second;
   }
+  trace_list.clear();
 }
 
 void tmgr_trace_event_unref(tmgr_trace_event_t* trace_event)
index c498ee6..30b261e 100644 (file)
@@ -29,6 +29,7 @@ public:
   void apply_event(tmgr_trace_event_t event, double value)
   {
     XBT_VERB("t=%.1f: Change value to %lg (idx: %d)", thedate, value, event->idx);
+    tmgr_trace_event_unref(&event);
   }
   bool isUsed() { return true; }
 };
@@ -61,6 +62,7 @@ static void trace2vector(const char* str, std::vector<tmgr::DatedValue>* whereto
       XBT_DEBUG("%.1f: ignore an event (idx: %d)\n", thedate, it->idx);
     }
   }
+  tmgr_finalize();
 }
 
 /* Fails in a way that is difficult to test: xbt_assert should become throw