summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2018-04-15 11:28:33 +0100
committerPhilippe Normand <philn@igalia.com>2018-04-15 11:28:33 +0100
commit1533775381b0201bdcc6dde2a06d2f87060551fa (patch)
treeb1d2c9344b4e9c5030c7fc353c6f2c1ac8d4e0fd
parent8a9d72b7e66b6079743a532f9c969424b96ae1dc (diff)
debug-viewer: Dispatcher source ID clean-up
This patch fixes this runtime warning: GstDebugViewer/Common/Data.py:67: Warning: Source ID 17 was not found when attempting to remove it GObject.source_remove(self.source_id)
-rw-r--r--debug-viewer/GstDebugViewer/Common/Data.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/debug-viewer/GstDebugViewer/Common/Data.py b/debug-viewer/GstDebugViewer/Common/Data.py
index 500e72a..d743a47 100644
--- a/debug-viewer/GstDebugViewer/Common/Data.py
+++ b/debug-viewer/GstDebugViewer/Common/Data.py
@@ -56,8 +56,14 @@ class GSourceDispatcher (Dispatcher):
if self.source_id is not None:
GObject.source_remove(self.source_id)
+ def iteration():
+ r = iterator.__next__()
+ if not r:
+ self.source_id = None
+ return r
+
self.source_id = GObject.idle_add(
- iterator.__next__, priority=GObject.PRIORITY_LOW)
+ iteration, priority=GObject.PRIORITY_LOW)
def cancel(self):