live with the hacks, PCRE's design is crap

This commit is contained in:
Araq 2019-03-19 15:49:24 +01:00
commit eeae88d81e
3 changed files with 6 additions and 5 deletions

View file

@ -442,7 +442,7 @@ proc extractOptions(pattern: string): tuple[pattern: string, flags: int, study:
# }}}
proc destroyRegex(pattern: Regex) =
pcre.free(pattern.pcreObj)
pcre.free_substring(cast[cstring](pattern.pcreObj))
pattern.pcreObj = nil
if pattern.pcreExtra != nil:
pcre.free_study(pattern.pcreExtra)