mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Don't forget to unregister route when the owning process is dead
This commit is contained in:
parent
3f7d9e3ad6
commit
ad902c2e16
@ -358,6 +358,9 @@ handle_info({'DOWN', MRef, _, Pid, Info}, State) ->
|
||||
?DEBUG("Process ~p with route registered to ~s "
|
||||
"has terminated unexpectedly with reason: ~p",
|
||||
[P, Domain, Info]),
|
||||
try unregister_route(Domain, Pid)
|
||||
catch _:_ -> ok
|
||||
end,
|
||||
false;
|
||||
(_, _) ->
|
||||
true
|
||||
@ -462,7 +465,12 @@ monitor_route(Domain, Pid) ->
|
||||
|
||||
-spec demonitor_route(binary(), pid()) -> ok.
|
||||
demonitor_route(Domain, Pid) ->
|
||||
?GEN_SERVER:call(?MODULE, {demonitor, Domain, Pid}, ?CALL_TIMEOUT).
|
||||
case whereis(?MODULE) == self() of
|
||||
true ->
|
||||
ok;
|
||||
false ->
|
||||
?GEN_SERVER:call(?MODULE, {demonitor, Domain, Pid}, ?CALL_TIMEOUT)
|
||||
end.
|
||||
|
||||
-spec get_backend() -> module().
|
||||
get_backend() ->
|
||||
|
Loading…
Reference in New Issue
Block a user