title: Python process does not exit on GTK loop exit
body: <h3>problem</h3>
  
  <p>I am loosely following <a href="http://python-gtk-3-tutorial.readthedocs.org/en/latest/builder.html" rel="nofollow noreferrer">this Python GTK tutorial</a>, but the Python process itself does not exit after the gtk main loop is exited, and does not respond to a terminal interrupt either--it has to be killed (SIGTERM). Here is my complete code:</p>
  
  <pre><code>from gi.repository import Gtk
  from sys import exit
  
  # debugger
  # import pdb; pdb.set_trace()
  
  class Handler:
      def on_MainWindow_destroy(self):
          Gtk.main_quit(*args)
          exit()
  
  if __name__ == '__main__':
      builder = Gtk.Builder()
      builder.add_from_file('gtkgui.glade')
      builder.connect_signals(Handler())
  
      window = builder.get_object("window1")
      window.show_all()
  
      Gtk.main()
  </code></pre>
  
  <p>I ran the script with a glade interface, and it appears okay, interacts visually, and closes on exit, but the python process stays running and does not let go of the terminal. (I am running Ubuntu 12.10 at the moment.)</p>
  
  <pre><code>[21時25分47秒]▶ python --version
  Python 2.7.3
  [21時25分47秒]▶ python clientest.py 
  
  (window appears, close window)
  ^C^C^C^C^C^C
  (no response)
  </code></pre>
  
  <h3>what I tried</h3>
  
  <p>I added <code>quit()</code> and <code>exit()</code> separately following suggestions from <a href="https://stackoverflow.com/questions/73663/terminating-a-python-script">this question</a> with no change in behavior.</p>
  
  <p>I also tried debugging following the instructions from <a href="https://stackoverflow.com/questions/2785028/python-process-will-not-exit">this question</a>, but the debugger also seems to hang along with the script at the end.</p>
  
  <h3>question</h3>
  
  <p>Is this expected behavior? How to ensure the Python process quits when the GTK loop is ended?</p>