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)
This commit is contained in:
Philippe Normand 2018-04-15 11:28:33 +01:00
parent 8a9d72b7e6
commit 1533775381

View file

@ -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):