From 442b50ad78cb9896edbb15cabd9021ee6ab98158 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 20 Jan 2021 13:35:31 -0800 Subject: [PATCH] Ensure the the timers are all stopped when the Timer sample is shutdown --- demo/Timer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/demo/Timer.py b/demo/Timer.py index 3ca95bb5..673bed27 100644 --- a/demo/Timer.py +++ b/demo/Timer.py @@ -219,6 +219,12 @@ class TestPanel(sp.ScrolledPanel): self.log.write("got wx.PyTimer event\n") + def ShutdownDemo(self): + for t in ['t1', 't2', 't3', 't4']: + if hasattr(self, t): + print('Stopping:', t) + timer = getattr(self, t) + timer.Stop() #----------------------------------------------------------------------