|
@@ -44,6 +44,7 @@ public:
|
|
|
ctkDependencyGraph* const q_ptr;
|
|
|
|
|
|
ctkDependencyGraphPrivate(ctkDependencyGraph& p);
|
|
|
+ ~ctkDependencyGraphPrivate();
|
|
|
|
|
|
/// Compute outdegree
|
|
|
void computeOutdegrees(std::vector<int>& computedOutdegrees);
|
|
@@ -167,6 +168,18 @@ ctkDependencyGraphPrivate::ctkDependencyGraphPrivate(ctkDependencyGraph& object)
|
|
|
this->CycleEnd = 0;
|
|
|
}
|
|
|
|
|
|
+ctkDependencyGraphPrivate::~ctkDependencyGraphPrivate()
|
|
|
+{
|
|
|
+ std::vector<std::vector<int>* >::iterator edgesIterator;
|
|
|
+ for (edgesIterator = this->Edges.begin(); edgesIterator != this->Edges.end(); edgesIterator++)
|
|
|
+ {
|
|
|
+ if (*edgesIterator != NULL)
|
|
|
+ {
|
|
|
+ delete *edgesIterator;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
void ctkDependencyGraphPrivate::computeOutdegrees(std::vector<int>& computedOutdegrees)
|
|
|
{
|
|
@@ -436,10 +449,9 @@ ctkDependencyGraph::ctkDependencyGraph(int nvertices)
|
|
|
//----------------------------------------------------------------------------
|
|
|
ctkDependencyGraph::~ctkDependencyGraph()
|
|
|
{
|
|
|
- // Clean memory
|
|
|
- for (int i=0; i <= d_ptr->NVertices; i++)
|
|
|
+ if (d_ptr != NULL)
|
|
|
{
|
|
|
- delete d_ptr->Edges[i];
|
|
|
+ delete d_ptr;
|
|
|
}
|
|
|
}
|
|
|
|