We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8561cc3 commit 1d15e9fCopy full SHA for 1d15e9f
base/regex.jl
@@ -39,7 +39,12 @@ mutable struct Regex <: AbstractPattern
39
end
40
re = compile(new(pattern, compile_options, match_options, C_NULL))
41
finalizer(re) do re
42
- re.regex == C_NULL || PCRE.free_re(re.regex)
+ # don't free during exit because tasks may still be running and
43
+ # using it. Issue #57817
44
+ during_exit = Base._atexit_hooks_finished
45
+ if re.regex != C_NULL && !during_exit
46
+ PCRE.free_re(re.regex)
47
+ end
48
49
re
50
0 commit comments