From cd23c95760e0fb1dbb5af5f2aa07667a2228a869 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 16 Sep 2020 23:15:00 -0400 Subject: [PATCH] display: Remove circular references from intermediate context object Explicilty clear the local context object so that it does not require a gc sweep to free it. Signed-off-by: Kevin O'Connor --- klippy/extras/display/display.py | 1 + 1 file changed, 1 insertion(+) diff --git a/klippy/extras/display/display.py b/klippy/extras/display/display.py index 38a95cf4..d3db32a3 100644 --- a/klippy/extras/display/display.py +++ b/klippy/extras/display/display.py @@ -79,6 +79,7 @@ class DisplayGroup: for row, col, template in self.data_items: text = template.render(context) display.draw_text(row, col, text.replace('\n', ''), eventtime) + context.clear() # Remove circular references for better gc class PrinterLCD: def __init__(self, config):