From d66f3febd120a6e888250dd9fa80b1533591d68f Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 27 Oct 2023 13:32:10 +0800 Subject: [PATCH] fixes #22868; fixes `std/nre` leaks under ARC/ORC (#22872) fixes #22868 --- lib/impure/nre.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim index 2c1b1deaeee09..422b1b68c7920 100644 --- a/lib/impure/nre.nim +++ b/lib/impure/nre.nim @@ -217,9 +217,11 @@ type ## code. proc destroyRegex(pattern: Regex) = + `=destroy`(pattern.pattern) pcre.free_substring(cast[cstring](pattern.pcreObj)) if pattern.pcreExtra != nil: pcre.free_study(pattern.pcreExtra) + `=destroy`(pattern.captureNameToId) proc getinfo[T](pattern: Regex, opt: cint): T = let retcode = pcre.fullinfo(pattern.pcreObj, pattern.pcreExtra, opt, addr result)