From d2a9cf037f2d7891e53b0e39d9b41ae6417981fb Mon Sep 17 00:00:00 2001 From: Peter Hinch Date: Thu, 24 Mar 2022 16:59:42 +0000 Subject: [PATCH] ugui.py: Enable user to disable GC. --- gui/core/ugui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/core/ugui.py b/gui/core/ugui.py index 3f33006..3142cb8 100644 --- a/gui/core/ugui.py +++ b/gui/core/ugui.py @@ -240,6 +240,7 @@ class Display: class Screen: + do_gc = True # Allow user to take control of GC current_screen = None is_shutdown = Event() # These events enable user code to synchronise display refresh @@ -397,7 +398,7 @@ class Screen: self.width = ssd.width self.row = 0 self.col = 0 - if Screen.current_screen is None: # Initialising class and task + if Screen.current_screen is None and Screen.do_gc: # Initialising class and task # Here we create singleton tasks asyncio.create_task(self._garbage_collect()) Screen.current_screen = self