Fix issue #1340 - erlang:demonitor/1 the reference when erasing the monitor
This commit is contained in:
parent
d794273bdb
commit
14771cdaee
|
@ -152,6 +152,7 @@ monitor_client(ClientId, Pid, State = #state{monitors = Monitors}) ->
|
||||||
State#state{monitors = dict:store(MRef, {ClientId, Pid}, Monitors)}.
|
State#state{monitors = dict:store(MRef, {ClientId, Pid}, Monitors)}.
|
||||||
|
|
||||||
erase_monitor(MRef, State = #state{monitors = Monitors}) ->
|
erase_monitor(MRef, State = #state{monitors = Monitors}) ->
|
||||||
|
erlang:demonitor(MRef, [flush]),
|
||||||
State#state{monitors = dict:erase(MRef, Monitors)}.
|
State#state{monitors = dict:erase(MRef, Monitors)}.
|
||||||
|
|
||||||
setstats(State = #state{statsfun = StatsFun}) ->
|
setstats(State = #state{statsfun = StatsFun}) ->
|
||||||
|
|
|
@ -310,5 +310,6 @@ monitor_session(ClientId, SessPid, State = #state{monitors = Monitors}) ->
|
||||||
State#state{monitors = dict:store(MRef, ClientId, Monitors)}.
|
State#state{monitors = dict:store(MRef, ClientId, Monitors)}.
|
||||||
|
|
||||||
erase_monitor(MRef, State = #state{monitors = Monitors}) ->
|
erase_monitor(MRef, State = #state{monitors = Monitors}) ->
|
||||||
|
erlang:demonitor(MRef, [flush]),
|
||||||
State#state{monitors = dict:erase(MRef, Monitors)}.
|
State#state{monitors = dict:erase(MRef, Monitors)}.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue