GNOME Bugzilla – Bug 401411
Ctrl-C in gnome-terminal crashes the game
Last modified: 2008-03-19 12:28:41 UTC
What were you doing when the application crashed? 1. Run gnome-sudoku from gnome-terminal 2. In the terminal, press Ctrl-C. 3. Gnome-sudoku crashes. Distribution: openSUSE 10.2 (i586) Gnome Release: 2.16.1 2006-11-28 (SUSE) BugBuddy Version: 2.17.3 System: Linux 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 i686 X Vendor: The X.Org Foundation X Vendor Release: 70199902 Selinux: No Accessibility: Disabled GTK+ Theme: Gilouche Icon Theme: Industrial Memory status: size: 0 vsize: 0 resident: 0 share: 0 rss: 0 rss_rlim: 0 CPU usage: start_time: 0 rtime: 0 utime: 0 stime: 0 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 0 ----------- .xsession-errors (1126 sec old) --------------------- Initializing nautilus-share extension Initializing nautilus-open-terminal extension Initializing gnome-mount extension (gnome-panel:4174): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -15 and height 24 ** Message: drive = 0 ** Message: volume = 0 ** Message: drive = 0 ** Message: volume = 0 ** Message: drive = 0 ** Message: volume = 0 (gnome-terminal:4263): Vte-WARNING **: Ingen håndterer definert for kontrollsekvens «device-control-string». (gnome-terminal:4263): Vte-WARNING **: Ingen håndterer definert for kontrollsekvens «device-control-string». -------------------------------------------------- Traceback (most recent call last):
+ Trace 105725
start_game()
u.quit_cb()
gtk.main_quit()
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 401372 ***
*** Bug 412480 has been marked as a duplicate of this bug. ***
*** Bug 439698 has been marked as a duplicate of this bug. ***
*** Bug 460426 has been marked as a duplicate of this bug. ***
This fix prevents the traceback. Not sure if there is a more elegant way to shutdown on a KeyboardInterrupt; I tried emitting a GTK destroy event but then you need to reenter the main loop which causes tricky logic when quitting normally: --- gnome_sudoku.py 2006-06-18 10:03:30.000000000 -0500 +++ gnome_sudoku_fix.py 2007-07-27 14:15:54.000000000 -0500 @@ -492,7 +492,12 @@ self.gconf['current_game']=self.sudoku_tracker.save_game(self) self.stop_worker_thread() self.sudoku_tracker.save() - gtk.main_quit() + # allow KeyboardInterrupts, which calls quit_cb outside the main loop + try: + gtk.main_quit() + except RuntimeError, e: + #print "ignoring RunTimeError raised by main_quit(): %s" % str(e) + pass @simple_debug def enter_game_by_hand (self, *args):
Thanks for the patch, Quentin. I applied it to SVN: http://svn.gnome.org/viewcvs/gnome-games?view=revision&revision=6557
*** Bug 523321 has been marked as a duplicate of this bug. ***