[kupfer] browser: Wait maximally 100 events before quitting
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] browser: Wait maximally 100 events before quitting
- Date: Sun, 23 Aug 2009 11:27:10 +0000 (UTC)
commit a7d41001feb7f8e802cce4beb687a92671826e84
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Sat Aug 22 20:51:59 2009 +0200
browser: Wait maximally 100 events before quitting
At quit, we wait for some processes to complete, but we decide we are
going to wait maximally 100 events.
kupfer/browser.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index 83f5a76..ca340ef 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -1344,7 +1344,11 @@ class WindowController (pretty.OutputMixin):
gtk.main()
# put away window *before exiting further*
self.put_away()
- while gtk.events_pending():
+ max_events = 100
+ # use sentinel form of iter
+ for idx, pending in enumerate(iter(gtk.events_pending, False)):
+ if idx > max_events:
+ break
gtk.main_iteration()
except KeyboardInterrupt, info:
self.output_info(info, "exiting.. (Warning: Ctrl-C in the shell",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]