ugui.py: Enable user to disable GC.

pull/16/head
Peter Hinch 2022-03-24 16:59:42 +00:00
rodzic c31d465f7a
commit d2a9cf037f
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

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