From 8531d5e4abb4b85ef228a52e7972391bcf808075 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 18 Jul 2021 14:56:48 +0200 Subject: [PATCH] properly shutdown and unblock the final buffer --- csdr/chain/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/csdr/chain/__init__.py b/csdr/chain/__init__.py index 53afda0..cb365d5 100644 --- a/csdr/chain/__init__.py +++ b/csdr/chain/__init__.py @@ -18,10 +18,10 @@ class Chain: w2.setInput(buffer) def stop(self): - if self.output is not None: - self.output.stop() for w in self.workers: w.stop() + self.setInput(None) + self.setOutput(None) def setInput(self, buffer): if self.input == buffer: @@ -32,6 +32,8 @@ class Chain: def setOutput(self, buffer): if self.output == buffer: return + if self.output is not None: + self.output.stop() self.output = buffer self.workers[-1].setOutput(buffer)