Permalink
Browse files

gc pcre regex_compile data

  • Loading branch information...
1 parent 5d222cf commit f1223570eaa21e06cc900f1eedede47f199ea2b8 @vtjnash vtjnash committed Jan 3, 2014
Showing with 2 additions and 2 deletions.
  1. +1 −1 base/pcre.jl
  2. +1 −1 base/regex.jl
View
@@ -104,7 +104,7 @@ study(re::Ptr{Void}) = study(re, int32(0))
free_study(extra::Ptr{Void}) =
ccall((:pcre_free_study, :libpcre), Void, (Ptr{Void},), extra)
free(regex::Ptr{Void}) =
- ccall((:pcre_free, :libpcre), Void, (Ptr{Void},), regex)
+ ccall(unsafe_load(cglobal((:pcre_free, :libpcre),Ptr{Void})), Void, (Ptr{Void},), regex)
exec(regex::Ptr{Void}, extra::Ptr{Void}, str::SubString, offset::Integer, options::Integer, cap::Bool) =
exec(regex, extra, str.string, str.offset, offset, sizeof(str), options, cap)
View
@@ -20,7 +20,7 @@ type Regex
finalizer(re,
function(re::Regex)
re.extra != C_NULL && PCRE.free_study(re.extra)
- #re.regex != C_NULL && PCRE.free(re.regex) # why does this cause a bus error?
+ re.regex != C_NULL && PCRE.free(re.regex)
end)
re
end

0 comments on commit f122357

Please sign in to comment.