From 4c9567515f3960c03461e3c14db07c2229ea498b Mon Sep 17 00:00:00 2001 From: Artem Golubin Date: Sun, 21 Jan 2024 11:53:59 +0400 Subject: [PATCH] Fix memory leak --- CHANGES.rst | 8 ++++++++ selectolax/lexbor.pyx | 2 +- selectolax/lexbor/selection.pxi | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index e450461..b369002 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,14 @@ selectolax Changelog ==================== +Version 0.3.15 +------------- + +Released + +- Fix memory leak when using CSS selectors, `lexbor` backend + + Version 0.3.17 ------------- diff --git a/selectolax/lexbor.pyx b/selectolax/lexbor.pyx index 58a138f..f804a93 100644 --- a/selectolax/lexbor.pyx +++ b/selectolax/lexbor.pyx @@ -237,7 +237,7 @@ cdef class LexborHTMLParser: def select(self, query=None): """Select nodes give a CSS selector. - Works similarly to the the ``css`` method, but supports chained filtering and extra features. + Works similarly to the ``css`` method, but supports chained filtering and extra features. Parameters ---------- diff --git a/selectolax/lexbor/selection.pxi b/selectolax/lexbor/selection.pxi index 94b7506..0a3e45c 100644 --- a/selectolax/lexbor/selection.pxi +++ b/selectolax/lexbor/selection.pxi @@ -72,6 +72,7 @@ cdef class LexborCSSSelector: raise SelectolaxError("Can't parse CSS selector.") result = bool(self.results) self.results = [] + lxb_css_selector_list_destroy_memory(selectors_list) return result