summary refs log tree commit diff stats
path: root/lib/impure
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-10-27 13:32:10 +0800
committerGitHub <noreply@github.com>2023-10-27 07:32:10 +0200
commitd66f3febd120a6e888250dd9fa80b1533591d68f (patch)
tree38dd6b7e35c0ced6bf046117c9ab4af856630c68 /lib/impure
parent0e45b01b210bbf1bc535cc73fcb3fe649a343168 (diff)
downloadNim-d66f3febd120a6e888250dd9fa80b1533591d68f.tar.gz
fixes #22868; fixes `std/nre` leaks under ARC/ORC (#22872)
fixes #22868
Diffstat (limited to 'lib/impure')
-rw-r--r--lib/impure/nre.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim
index 2c1b1deae..422b1b68c 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)