diff --git a/bin/curvecalc b/bin/curvecalc --- a/bin/curvecalc +++ b/bin/curvecalc @@ -15,7 +15,7 @@ from twisted.internet import gtk2reactor gtk2reactor.install() from twisted.internet import reactor -import time, textwrap, os, optparse, urllib2, gtk, gobject, linecache +import time, textwrap, os, optparse, urllib2, gtk, gobject, linecache, signal import louie as dispatcher from twisted.python.util import sibpath from rdflib import URIRef @@ -51,7 +51,8 @@ class Main(object): wtree = gtk.Builder() wtree.add_from_file(sibpath(__file__, "../light9/curvecalc/curvecalc.glade")) mainwin = wtree.get_object("MainWindow") - mainwin.connect("destroy", gtk.main_quit) + + mainwin.connect("destroy", self.onQuit) wtree.connect_signals(self) mainwin.show_all() @@ -103,6 +104,12 @@ class Main(object): self.makeStatusLines(wtree.get_object("status")) + def onQuit(self, *args): + reactor.crash() + # there's a hang after this, maybe in sem_wait in two + # threads. I don't know whose they are. + os.kill(os.getpid(), signal.SIGKILL) + def onSeeCurrentTime(self, item): dispatcher.send("see time") diff --git a/light9/curvecalc/curvecalc.glade b/light9/curvecalc/curvecalc.glade --- a/light9/curvecalc/curvecalc.glade +++ b/light9/curvecalc/curvecalc.glade @@ -41,6 +41,8 @@ False True True + +