From: Magnus Jacobsson Date: Tue, 12 Jul 2022 13:15:50 +0000 (+0200) Subject: remove GD_drawing(g) NULL guard X-Git-Tag: 5.0.1~31^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bedb84b1654d3bd58e8db481ec81bf43cf95f82;p=graphviz remove GD_drawing(g) NULL guard 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?). --- diff --git a/lib/gvc/gvlayout.c b/lib/gvc/gvlayout.c index df5a176cf..95c2c0979 100644 --- a/lib/gvc/gvlayout.c +++ b/lib/gvc/gvlayout.c @@ -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; }