Skip to content

Commit

Permalink
fixes #22868; releases Regex resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Oct 26, 2023
1 parent 7c3917d commit 817a863
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 817a863

Please sign in to comment.