Changeset

12878:0d8bf401fa73 0.12

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.
author Kim Alvefur <zash@zash.se>
date Thu, 19 Jan 2023 21:40:09 +0100
parents 12877:f6cca7cbf3b2
children 12879:09a53ed8f4d5
files core/sessionmanager.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;