glejeune / node-graphviz

Node.js interface to the GraphViz graphing tool
http://algorithmique.net
MIT License
197 stars 58 forks source link

Graph render race condition issues. #14

Open arian opened 11 years ago

arian commented 11 years ago

Using Graph.render, there are some race conditions with graphviz.on("exit", …), where exit fires before the graphviz.stdout is ended.

So instead of using exit, you can use close in node 0.8. So a solution would be, in graph.js:373

  var version = process.version.split('.')[1]
  graphviz.on(version < 8 ? 'exit' : 'close', function(code) {
  // ...
  });