]> granicus.if.org Git - graphviz/commitdiff
Fix gv.rm function on graphs to just call agclose().
authorEmden R. Gansner <erg@alum.mit.edu>
Fri, 28 Feb 2014 15:52:38 +0000 (10:52 -0500)
committerEmden R. Gansner <erg@alum.mit.edu>
Fri, 28 Feb 2014 15:52:38 +0000 (10:52 -0500)
tclpkg/gv/gv.cpp

index 56435f6174e24ae9143645f96c220120f9ecfacf..23e13568c3cf6619ee098647dace1e4479d5860e 100644 (file)
@@ -767,13 +767,20 @@ bool rm(Agraph_t *g)
 
     if (!g)
         return false;
+#if 0
     Agraph_t* sg;
     for (sg = agfstsubg (g); sg; sg = agnxtsubg (sg))
        rm(sg);
     if (g == agroot(g))
        agclose(g);
     else
-        agdelete(agroot(g), g);
+        agdelete(agparent(g), g);
+#endif
+    /* The rm function appears to have the semantics of agclose, so
+     * we should just do that, and let cgraph take care of all the
+     * details.
+     */
+    agclose(g);
     return true;
 }