From d0146475b6305caef7449c4df5ecd0ac3a73055f Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 30 Aug 2022 12:20:00 +0200 Subject: [PATCH] memory GC workaround --- changedetectionio/content_fetcher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index d831ce84..f0b8acb0 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -407,7 +407,8 @@ class base_html_playwright(Fetcher): else: page.evaluate("var css_filter=''") - self.xpath_data = page.evaluate("async () => {" + self.xpath_element_js + "}") + # str() here must create a dereferenced copy, which allows the GC to release correctly + self.xpath_data = str(page.evaluate("async () => {" + self.xpath_element_js + "}")) # Bug 3 in Playwright screenshot handling # Some bug where it gives the wrong screenshot size, but making a request with the clip set first seems to solve it