Skip to content

Commit

Permalink
fixes #22868; fixes std/nre leaks under ARC/ORC (#22872)
Browse files Browse the repository at this point in the history
fixes #22868

(cherry picked from commit d66f3fe)
  • Loading branch information
ringabout authored and narimiran committed Oct 29, 2023
1 parent 805b4e2 commit 1db305a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/impure/nre.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1db305a

Please sign in to comment.