From 176b0b64ea69411ea6f72774c52b2a700ff049bb Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Thu, 26 May 2016 19:50:08 +0800 Subject: [PATCH] GC after a session DOWN --- src/emqttd_sm.erl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/emqttd_sm.erl b/src/emqttd_sm.erl index e3e893a58..05aed7b42 100644 --- a/src/emqttd_sm.erl +++ b/src/emqttd_sm.erl @@ -117,8 +117,7 @@ call(SM, Req) -> init([Pool, Id]) -> ?GPROC_POOL(join, Pool, Id), - {ok, #state{pool = Pool, id = Id, - monitors = dict:new()}}. + {ok, #state{pool = Pool, id = Id, monitors = dict:new()}}. prioritise_call(_Msg, _From, _Len, _State) -> 1. @@ -175,7 +174,7 @@ handle_info({'DOWN', MRef, process, DownPid, _Reason}, State) -> [_Sess] -> ok end end), - {noreply, erase_monitor(MRef, State)}; + {noreply, erase_monitor(MRef, State), hibernate}; error -> lager:error("MRef of session ~p not found", [DownPid]), {noreply, State}