Number: 1981
Title: memory leaks in gvLayout
Submitter: Igor Studenov
Date: Thu Jun 17 08:16:57 2010
Subsys: Lib(c)graph
Version: 2.26.3 (20100126.1600)
System: *-Windows-
Severity: major
Problem:
Hi

It seems that there are several memory leaks

following sample works fine


  aginit;
  gvc = gvContext;

g = agopen("g", AGRAPH); sg = agsubg(g, "g0"); /* A */ n1 = agnode(sg, "A"); n2 = agnode(sg, "B"); e = agedge(sg, n1, n2); agsafeset(e, "label", "edge", ""); /* B */

while( 1 ) { gvLayout(gvc, g, "dot"); gvFreeLayout(gvc, g); }

agclose(g); gvFreeContext(gvc);

but if we change line /* A */ to


  sg = agsubg(g, "cluster_g0");
we notice a memory leak

also memory leaks occur if we change line /* B */ to


  agsafeset(e, "label", "edlge", "");

the effect is repeated in any multi-line edge labels, including html-like tables.

if we move agopenagclose, as well as gvContextgvFreeContext into the loop, memory still leaking.
Owner: *
Status: *