graph. For root graph, this is cleaned up in graph_cleanup.
circular_cleanup_node(n);
}
free(GD_neato_nlist(g));
- memset(&(g->u), 0, sizeof(Agraphinfo_t));
+ if (g != g->root) memset(&(g->u), 0, sizeof(Agraphinfo_t));
}
free(GD_rank(g)[i].v);
free(GD_rank(g));
}
- memset(&(g->u), 0, sizeof(Agraphinfo_t));
+ if (g != g->root) memset(&(g->u), 0, sizeof(Agraphinfo_t));
}
/* delete the layout (but retain the underlying graph) */
cleanup_subgs(g);
free(GD_neato_nlist(g));
free(GD_alg(g));
- memset(&(g->u), 0, sizeof(Agraphinfo_t));
+ if (g != g->root) memset(&(g->u), 0, sizeof(Agraphinfo_t));
}
void fdp_cleanup(graph_t * g)
* First, if the graph has a layout-specific cleanup function attached,
* use it and reset.
* Then, if the root graph has not been cleaned up, clean it up and reset.
+ * Only the root graph has GD_drawing non-null.
*/
int gvFreeLayout(GVC_t * gvc, graph_t * g)
{
{
if (Nop || (Pack < 0))
free_scan_graph(g);
- memset(&(g->u), 0, sizeof(Agraphinfo_t));
+ if (g != g->root) memset(&(g->u), 0, sizeof(Agraphinfo_t));
}
void neato_cleanup(graph_t * g)
static void twopi_cleanup_graph(graph_t * g)
{
free(GD_neato_nlist(g));
- memset(&(g->u), 0, sizeof(Agraphinfo_t));
+ if (g != g->root) memset(&(g->u), 0, sizeof(Agraphinfo_t));
}
void twopi_cleanup(graph_t * g)