diff bin/curvecalc @ 700:d5692ab6bc2a

fix quit and ctrl-q by using kill -9 Ignore-this: db0474f9352cc297bf2e596ac42aee1c
author Drew Perttula <drewp@bigasterisk.com>
date Sun, 10 Jun 2012 05:57:15 +0000
parents d12bc8919d6e
children 417e23dc0af0
line wrap: on
line diff
--- a/bin/curvecalc	Sun Jun 10 05:33:25 2012 +0000
+++ b/bin/curvecalc	Sun Jun 10 05:57:15 2012 +0000
@@ -15,7 +15,7 @@
 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 @@
         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 @@
         
         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")