From 1533775381b0201bdcc6dde2a06d2f87060551fa Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sun, 15 Apr 2018 11:28:33 +0100 Subject: [PATCH] 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) --- debug-viewer/GstDebugViewer/Common/Data.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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): -- 2.7.4