quitting the mainloop.

Heston James heston_james at live.co.uk
Thu May 7 02:32:08 PDT 2009


Morning All!
I'm using dbus-python for an application here and I'm basically trying to have the application gracefully exit if an exception occurs in one of the event handlers by quitting the mainloop, however this seems to be a little unpredictable, I wanted to get your advice on whether I'm doing this right or not.
Take the follow code snippet at an example: http://pastebin.com/m6f619485
See, when the connection to the database is lost and an exception is thrown the main_loop.quit() is called. Now, I would expect this to end the application immediately however it appears that it continues on it's line of processing before doing so, in this particular instance I get a log message saying 'Seems we lost the connection to the database' however I then get another exception thrown which says:
'the variable 'current_events' was referenced before assignment.'
I would expect that 'if' block to be processed at all after the mainloop has been killed. Am I doing something wrong? Need I do more to ensure the application exits properly?
Thanks for your advice everyone, I appreciate it.
Heston
_________________________________________________________________
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20090507/c6e0f578/attachment.html 


More information about the dbus mailing list