# HG changeset patch # User Drew Perttula # Date 2012-06-10 05:57:15 # Node ID d5692ab6bc2aabd893a62cee9c43b7500b0f0be5 # Parent d12bc8919d6e3fd202de22c7bca1538a20546f8c fix quit and ctrl-q by using kill -9 Ignore-this: db0474f9352cc297bf2e596ac42aee1c 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 + +