hid/gtk: Fix NetlistChanged action crash when exporting from the commandline.
commit2b66cd7a7eec8b1d9394eb7e5feda0be3c7d47d3
authorPeter Clifton <pcjc2@cam.ac.uk>
Sat, 24 Dec 2011 17:14:04 +0000 (24 17:14 +0000)
committerPeter Clifton <pcjc2@cam.ac.uk>
Sat, 24 Dec 2011 17:25:07 +0000 (24 17:25 +0000)
tree01b56d3f125c467cd8798de62734d65f1e912b0f
parentc1536167c44f4424ce40d394fcfd260431173f58
hid/gtk: Fix NetlistChanged action crash when exporting from the commandline.

I broke this in commit 7308f512307158944482227d58e66373fd023d62 when I
added a missing notification to the GUI when free'ing the netlist. It turns
out that a command-line invoked export (such as used to export images in the
doc/ build) will hit this code-path, and provoke the GUI netlist window code
to try and update before the GUI is actually loaded.

For now, lets fix this with a bandaid and just skip the netlist update if the
GUI is not up.

A brief inspection of the code (and test for the doc/ build) suggests that the
Lesstif HID is not affected by this problem. (It has similar code to avoid
creating the netlist window if the main window is not already created).
src/hid/gtk/gui-netlist-window.c