Number: 1759
Title: No way to reset Nop when using graphviz as library
Submitter: Klaus Stein
Date: Fri Sep 4 05:59:22 2009
Subsys: Neato
Version: 2.20.2
System: *-*-
Severity: minor
Problem:
When using graphviz as a library you can du several calls to the rendering engines in sequence.

What I would like to do from my program is to use neato to compute the node positions and later use nop to lay out the graph. So far everything works fine. But if I now try to call neato again, the value of Nop is not reset to 0, so neato is unusable.

I triggered the bug using the ruby graphviz library, but it should not be ruby dependent. For ruby code to trigger this bug see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514753
Fix:
To fix this it may be sufficient to add one line to plugin/neato_layout/gvlayout_neato_layout.c (but I am not sure, I don't have any overview on the graphviz code, and fiddling around with globals is always error prone and may have hidden side effects):

gvlayout_engine_t neatogen_engine = { neato_layout, neato_cleanup, };

should be:

gvlayout_engine_t neatogen_engine = { Nop = 0; neato_layout, neato_cleanup, };
Owner: erg
Status: Fixed (4 Sep 2009)