Skip to content
Snippets Groups Projects
Commit b4e30ff0 authored by js's avatar js
Browse files

Apply my suggested patch from #4368. Fixes #4368.

parent f321d52d
No related branches found
No related tags found
No related merge requests found
......@@ -435,11 +435,19 @@ class GlibIdleQueue(idlequeue.IdleQueue):
''' this method is called when we plug a new idle object.
Start listening for events from fd
'''
res = gobject.io_add_watch(fd, flags, self.process_events,
res = gobject.io_add_watch(fd, flags, self._process_events,
priority=gobject.PRIORITY_LOW)
# store the id of the watch, so that we can remove it on unplug
self.events[fd] = res
def _process_events(self, fd, flags):
try:
return self.process_events(fd, flags)
except:
self.remove_idle(fd)
self.add_idle(fd, flags)
raise
def remove_idle(self, fd):
''' this method is called when we unplug a new idle object.
Stop listening for events from fd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment