]> granicus.if.org Git - ejabberd/commitdiff
Return ejabberd_sm:stop/0 back
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 24 Feb 2017 09:39:44 +0000 (12:39 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 24 Feb 2017 09:39:44 +0000 (12:39 +0300)
src/ejabberd_sm.erl

index 173b9a2ad6d0976747c9eca7c929f5cad3a9d7a4..5f7d9740c4b6b3e893da0312462880028821c785 100644 (file)
@@ -36,6 +36,7 @@
 
 %% API
 -export([start_link/0,
+        stop/0,
         route/1,
         route/2,
         process_iq/1,
 start_link() ->
     ?GEN_SERVER:start_link({local, ?MODULE}, ?MODULE, [], []).
 
+-spec stop() -> ok.
+stop() ->
+    supervisor:terminate_child(ejabberd_sup, ?MODULE),
+    supervisor:delete_child(ejabberd_sup, ?MODULE),
+    ok.
+
 -spec route(jid(), term()) -> ok.
 %% @doc route arbitrary term to c2s process(es)
 route(To, Term) ->