]> granicus.if.org Git - graphviz/commitdiff
remove GD_drawing(g) NULL guard
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 12 Jul 2022 13:15:50 +0000 (15:15 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 25 Jul 2022 18:24:49 +0000 (20:24 +0200)
This guard is unnecessary since `graph_cleanup` alrady has the
necessary guards. This also ensures that the Agraphinfo_t record and
the graph's label is cleaned away even if the graph for some reason
doesn't have a drawing (can this ever happen?).

lib/gvc/gvlayout.c

index df5a176cf43e5af044ec594bd7b275d8ef6c8600..95c2c09790301a36a7f77fc17dba79f93f6bd23f 100644 (file)
@@ -101,7 +101,7 @@ bool gvLayoutDone(Agraph_t * g)
  * Free layout resources.
  * First, if the graph has a layout-specific cleanup function attached,
  * use it and reset.
- * Then, if the graph has a drawing, do the general graph cleanup.
+ * Then do the general graph cleanup.
  */
 int gvFreeLayout(GVC_t * gvc, Agraph_t * g)
 {
@@ -116,8 +116,6 @@ int gvFreeLayout(GVC_t * gvc, Agraph_t * g)
        GD_cleanup(g) = NULL;
     }
     
-    if (GD_drawing(g)) {
-       graph_cleanup(g);
-    }
+    graph_cleanup(g);
     return 0;
 }