def quit():
 global qdb, listener, conn
 if qdb:
  sys.settrace(None)
  qdb = None
 if conn:
  conn.close()
  conn = None
 if listener:
  listener.close()
  listener = None

def quit ( ) : global qdb , listener , conn if qdb : sys . settrace ( None ) qdb = None if conn : conn . close ( ) conn = None if listener : listener . close ( ) listener = None
quit the native gui event loop .