Merge 0.10->trunk

This commit is contained in:
Matthew Wild 2016-09-12 22:31:25 +01:00
commit f4690a6063
5 changed files with 20 additions and 18 deletions

View file

@ -314,7 +314,9 @@ function listener.ondisconnect(conn, err)
local session = sessions[conn];
if session then
(session.log or log)("info", "component disconnected: %s (%s)", tostring(session.host), tostring(err));
module:fire_event("component-disconnected", { session = session, reason = err });
if session.host then
module:context(session.host):fire_event("component-disconnected", { session = session, reason = err });
end
if session.on_destroy then session:on_destroy(err); end
sessions[conn] = nil;
for k in pairs(session) do