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
  • Loading branch information
ringabout authored Oct 27, 2023
1 parent 0e45b01 commit d66f3fe
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 d66f3fe

Please sign in to comment.