Memory cleanup for multiple rendering after one single layout job?
If I call
gvLayout() and then
gvRenderData(), I should usually call
gvFreeRenderData(), gvFreeLayout(), agclose(), and
gvFreeContext() in that order to clean up the allocated memory.
Is it possible to reuse the layout for use with multiple renderers, or is this unwise? For example, I would do
neato layout with a graph DOT file, then render using
plain in order to read the generated graph size from the first line of output, then resize a display window in my GUI app, and then render the same layout as an SVG file. I imagine that I would have to call
gvFreeRenderData() after each rendering, but call
gvFreeLayout(), agclose() and
gvFreeContext() only once after the routine finishes.
Is this OK or will I leak memory and/or crash?