+2007-05-09 Peter Parente <parente@cs.unc.edu>
+
+ * registry.py: Fixed bug #436982 (Patch from Eitan), crash on exit
+ * utils.py: Fixed bug #437153, bad StateSet add/remove impl.
+
2007-05-08 Peter Parente <parente@cs.unc.edu>
* constants.py:
'''
self.async = async
- # register a signal handler for gracefully killing the loop
- signal.signal(signal.SIGINT, self.stop)
- signal.signal(signal.SIGTERM, self.stop)
-
if gil:
def releaseGIL():
- time.sleep(1e-5)
+ try:
+ time.sleep(1e-5)
+ except KeyboardInterrupt, e:
+ # store the exception for later
+ releaseGIL.keyboard_exception = e
+ self.stop()
return True
+ # make room for an exception if one occurs during the
+ releaseGIL.keyboard_exception = None
i = gobject.idle_add(releaseGIL)
# enter the main loop
- bonobo.main()
-
- if gil:
- gobject.source_remove(i)
-
+ try:
+ bonobo.main()
+ except KeyboardInterrupt, e:
+ # re-raise the keyboard interrupt
+ raise e
+ finally:
+ # clear all observers
+ for name, ob in self.observers.items():
+ ob.unregister(self.reg, name)
+ if gil:
+ gobject.source_remove(i)
+ if releaseGIL.keyboard_exception is not None:
+ # re-raise the keyboard interrupt we got during the GIL release
+ raise releaseGIL.keyboard_exception
+
def stop(self, *args):
'''Quits the main loop.'''
try:
@param state: State(s) to add
@type state: Accessibility.StateType
'''
- self.states.add(state)
+ map(self.states.add, state)
def remove(self, *state):
'''
@param state: State(s) to remove
@type state: Accessibility.StateType
'''
- self.states.remove(state)
+ map(self.states.remove, state)
def equals(self, state_set):
'''