diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_utils.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 5ea0452..b633760 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -763,7 +763,13 @@ remove_from_code_path(Paths) -> ok; {ok, Modules} -> application:unload(App), - [begin code:purge(M), code:delete(M) end || M <- Modules] + [case erlang:check_process_code(self(), M) of + false -> + code:purge(M), code:delete(M); + _ -> + ?DEBUG("~p can't purge ~p safely, doing a soft purge", [self(), M]), + code:soft_purge(M) andalso code:delete(M) + end || M <- Modules] end, code:del_path(Path) end, lists:usort(Paths)). |