Skip to content

Commit

Permalink
Stop agent on exit.
Browse files Browse the repository at this point in the history
  • Loading branch information
chikatoike committed Jan 26, 2013
1 parent ae718c4 commit 2f95af0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sublimeibus/sublime-ibus-agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,13 @@ def __stdin_cb(self, fd, condition):
print_command('setq', 'error', traceback.format_exc())
return True

def __io_error_cb(self, fd, condition):
exit()

def run(self):
glib.idle_add(self.__start_cb)
glib.io_add_watch(0, glib.IO_IN, self.__stdin_cb)
glib.io_add_watch(0, glib.IO_ERR | glib.IO_HUP, self.__io_error_cb)
while True:
try:
super(IBusModeMainLoop, self).run()
Expand All @@ -568,7 +572,6 @@ def run(self):
if ic:
ic.destroy()


if __name__ == "__main__":

mainloop = IBusModeMainLoop(bus)
Expand Down

0 comments on commit 2f95af0

Please sign in to comment.