core.sessionmanager: Mark session as destroyed to prevent reentry
If it reaches this point, then the session will be most definitely be
destroyed, so try to prevent destroy_session() from being called again.
--- a/core/sessionmanager.lua Thu Jan 19 21:38:14 2023 +0100
+++ b/core/sessionmanager.lua Thu Jan 19 21:40:09 2023 +0100
@@ -106,6 +106,7 @@
if host_session.events.fire_event("pre-resource-unbind", {session=session, error=err}) then
return;
end
+ session.destroyed = true; -- Past this point the session is DOOMED!
host_session.sessions[session.username].sessions[session.resource] = nil;
full_sessions[session.full_jid] = nil;