don't call gtk.main_quit() from outside of a mainloop

This commit is contained in:
Yann Leboulanger 2009-05-01 09:37:13 +00:00
parent e6aea43665
commit 5d8e96ad47
2 changed files with 6 additions and 4 deletions

View File

@ -387,7 +387,7 @@ def on_exit():
if os.path.exists(pid_filename):
os.remove(pid_filename)
# Shutdown GUI and save config
gajim.interface.roster.quit_gtkgui_interface()
gajim.interface.roster.prepare_quit()
if sys.platform == 'darwin':
try:
osx.shutdown()

View File

@ -2206,9 +2206,7 @@ class RosterWindow:
self.on_quit_request()
return True # do NOT destroy the window
def quit_gtkgui_interface(self):
'''When we quit the gtk interface :
tell that to the core and exit gtk'''
def prepare_quit(self):
msgwin_width_adjust = 0
# in case show_roster_on_start is False and roster is never shown
@ -2239,6 +2237,10 @@ class RosterWindow:
self.close_all(account)
if gajim.interface.systray_enabled:
gajim.interface.hide_systray()
def quit_gtkgui_interface(self):
'''When we quit the gtk interface : exit gtk'''
self.prepare_quit()
gtk.main_quit()
def on_quit_request(self, widget=None):