From 42c8c2e26d6f60223da5bcc47c8c892b0c561077 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 18 Oct 2018 14:06:40 +0100 Subject: [PATCH] Fixed some dangling listeners in the BLOCKS demos --- examples/BLOCKS/BlocksDrawingDemo.h | 3 +++ examples/BLOCKS/BlocksMonitorDemo.h | 7 +++++++ examples/BLOCKS/BlocksSynthDemo.h | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/examples/BLOCKS/BlocksDrawingDemo.h b/examples/BLOCKS/BlocksDrawingDemo.h index 902a722f7c..b9d5d119a7 100644 --- a/examples/BLOCKS/BlocksDrawingDemo.h +++ b/examples/BLOCKS/BlocksDrawingDemo.h @@ -313,6 +313,8 @@ public: #endif setSize (600, 600); + + topologyChanged(); } ~BlocksDrawingDemo() @@ -321,6 +323,7 @@ public: detachActiveBlock(); lightpadComponent.removeListener (this); + topologySource.removeListener (this); } void resized() override diff --git a/examples/BLOCKS/BlocksMonitorDemo.h b/examples/BLOCKS/BlocksMonitorDemo.h index 2e1e4f3fca..2f3d02ca21 100644 --- a/examples/BLOCKS/BlocksMonitorDemo.h +++ b/examples/BLOCKS/BlocksMonitorDemo.h @@ -605,6 +605,13 @@ public: #endif setSize (600, 600); + + topologyChanged(); + } + + ~BlocksMonitorDemo() + { + topologySource.removeListener (this); } void paint (Graphics&) override {} diff --git a/examples/BLOCKS/BlocksSynthDemo.h b/examples/BLOCKS/BlocksSynthDemo.h index ba083659ee..0745c82cfa 100644 --- a/examples/BLOCKS/BlocksSynthDemo.h +++ b/examples/BLOCKS/BlocksSynthDemo.h @@ -607,12 +607,16 @@ public: #endif setSize (600, 400); + + topologyChanged(); } ~BlocksSynthDemo() { if (activeBlock != nullptr) detachActiveBlock(); + + topologySource.removeListener (this); } void paint (Graphics& g) override