Skip to content

Commit d70bcbe

Browse files
committed
use invokelatest for listenpkg
1 parent 1a4b0c6 commit d70bcbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/require.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const _callbacks = Dict{PkgId, Vector{Function}}()
1313
callbacks(pkg) = get!(()->[], _callbacks, pkg)
1414

1515
listenpkg(@nospecialize(f), pkg) =
16-
loaded(pkg) ? f() : push!(callbacks(pkg), f)
16+
loaded(pkg) ? Base.invokelatest(f) : push!(callbacks(pkg), f)
1717

1818
function loadpkg(pkg)
1919
if haskey(_callbacks, pkg)

0 commit comments

Comments
 (0)