Skip to content

another finalizer order fix#28107

Merged
JeffBezanson merged 2 commits intomasterfrom
jb/morefinalizerorder
Jul 15, 2018
Merged

another finalizer order fix#28107
JeffBezanson merged 2 commits intomasterfrom
jb/morefinalizerorder

Conversation

@JeffBezanson
Copy link
Copy Markdown
Member

This makes the atexit hook in Logging unnecessary.

Before:

julia> finalizer(println, [])
0-element Array{Any,1}

julia> 
error in running finalizer: ArgumentError(msg="stream is closed or unusable")
jeff@gurren:~/src/julia$ ./julia -q
julia> finalizer(x->@info(x), [])
0-element Array{Any,1}

julia> 
[ Info: Any[]

after:

julia> finalizer(println, [])
0-element Array{Any,1}

julia> 
Any[]
jeff@gurren:~/src/julia$ ./julia -q
julia> finalizer(x->@info(x), [])
0-element Array{Any,1}

julia> 
[ Info: Any[]

This ordering makes it much more likely that older finalizers will
run first.
This is fixed more generally by running finalizers in stack order.
@JeffBezanson JeffBezanson merged commit 67ca557 into master Jul 15, 2018
@JeffBezanson JeffBezanson deleted the jb/morefinalizerorder branch July 15, 2018 03:23
@c42f c42f mentioned this pull request Sep 19, 2018
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant