fix memory leak
[model-checker.git] / cyclegraph.cc
index 240d24ffadd0b52af69e9318e53172f0806c6bb8..8d37dea8b9fc6ea6770528e57238df13d2b5a323 100644 (file)
@@ -8,7 +8,7 @@
 /** Initializes a CycleGraph object. */
 CycleGraph::CycleGraph() :
        discovered(new HashTable<const CycleNode *, const CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free>(16)),
-       queue(new       std::vector< const CycleNode *, ModelAlloc<const CycleNode *> >()),
+       queue(new ModelVector<const CycleNode *>()),
        hasCycles(false),
        oldCycles(false)
 {
@@ -17,6 +17,7 @@ CycleGraph::CycleGraph() :
 /** CycleGraph destructor */
 CycleGraph::~CycleGraph()
 {
+       delete queue;
        delete discovered;
 }
 
@@ -553,7 +554,7 @@ unsigned int CycleNode::getNumBackEdges() const
  * @return True if the element was found; false otherwise
  */
 template <typename T>
-static bool vector_remove_node(std::vector<T, SnapshotAlloc<T> >& v, const T n)
+static bool vector_remove_node(SnapVector<T>& v, const T n)
 {
        for (unsigned int i = 0; i < v.size(); i++) {
                if (v[i] == n) {