aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/xmppserver_listener.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua
index 7c5b0d9c..111633d8 100644
--- a/net/xmppserver_listener.lua
+++ b/net/xmppserver_listener.lua
@@ -5,6 +5,7 @@ local init_xmlhandlers = require "core.xmlhandlers"
local sm_new_session = require "core.sessionmanager".new_session;
local s2s_new_incoming = require "core.s2smanager".new_incoming;
local s2s_streamopened = require "core.s2smanager".streamopened;
+local s2s_destroy_session = require "core.s2smanager".destroy_session;
local connlisteners_register = require "net.connlisteners".register;
@@ -70,6 +71,13 @@ function xmppserver.listener(conn, data)
end
function xmppserver.disconnect(conn)
+ local session = sessions[conn];
+ if session then
+ s2s_destroy_session(session);
+ sessions[conn] = nil;
+ session = nil;
+ collectgarbage("collect");
+ end
end
function xmppserver.register_outgoing(conn, session)