OK, I finally tracked down what was happening in that segfault. Essentially, the python c module in pyqt can become... lets charitably call it "confused"... when python destroys objects in an order it isn't expecting. So, when exiting hplip, python's garbage collection runs (or doesn't) and triggers the edge case (or doesn't).
There are many discussions of this on the pyqt mailing lists, and each time the suggestion was to do one of the following:
1) instantiate your objects in a different order, until you find an order which doesn't cause the problem
2) figure out which object(s) is causing the issue, and explicitly kill it before you call QApplication.quit()
This message on the topic is somewhat enlightening: http://<email address hidden>/msg20499.html
However, since the segfault occurs even without my patch, I've filed it (along with a fix using #2 above) as launchpad bug #546816
OK, I finally tracked down what was happening in that segfault. Essentially, the python c module in pyqt can become... lets charitably call it "confused"... when python destroys objects in an order it isn't expecting. So, when exiting hplip, python's garbage collection runs (or doesn't) and triggers the edge case (or doesn't).
There are many discussions of this on the pyqt mailing lists, and each time the suggestion was to do one of the following:
1) instantiate your objects in a different order, until you find an order which doesn't cause the problem
2) figure out which object(s) is causing the issue, and explicitly kill it before you call QApplication.quit()
This message on the topic is somewhat enlightening: http://<email address hidden> /msg20499. html
However, since the segfault occurs even without my patch, I've filed it (along with a fix using #2 above) as launchpad bug #546816