Skip to content
Snippets Groups Projects
Commit 17e478e3 authored by i-bird's avatar i-bird
Browse files

Fixing memory leaks

parent 4e492768
No related branches found
No related tags found
No related merge requests found
Pipeline #2682 passed
Subproject commit 9b94f15fa6f4086295dbd52184f4377e05eaa30d
Subproject commit c8048e7898e3a20d1ad1749d82d750e743247d8a
......@@ -23,6 +23,9 @@ if [ x"$pcman" == x"apt-get" ]; then
if [ $? -eq 0 ]; then
base_python_pkg="python2 $base_python_pkg"
fi
elif [ x"$pcman" == x"zypper" ]; then
base_python=python2
additional_python_pkg=python3
fi
if [ x"$1" = x"linux" ]; then
......
......@@ -133,6 +133,16 @@ class Metis
void constructAdjListWithWeights(Graph & g)
{
// create xadj, adjlist, vwgt, adjwgt and vsize
if (Mg.xadj != NULL)
{delete [] Mg.xadj;}
if (Mg.adjncy != NULL)
{delete [] Mg.adjncy;}
if (Mg.vwgt != NULL)
{delete [] Mg.vwgt;}
if (Mg.adjwgt != NULL)
{delete [] Mg.adjwgt;}
if (Mg.vsize != NULL)
{delete [] Mg.vsize;}
Mg.xadj = new idx_t[g.getNVertex() + 1];
Mg.adjncy = new idx_t[g.getNEdge()];
Mg.vwgt = new idx_t[g.getNVertex()];
......@@ -387,6 +397,10 @@ public:
{
delete[] Mg.part;
}
if (Mg.vsize != NULL)
{
delete[] Mg.vsize;
}
}
/*! \brief Decompose the graph
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment