# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1224868480 -3600
# Node ID 8dc1faa5b1df76119fcdbe3899ed3f66212e116c
# Parent  3fec9b512d4ee9f6b75dc55aa6bc1bdb5ed96511
other half of previous commit

diff -r 3fec9b512d4e -r 8dc1faa5b1df core/s2smanager.lua
--- a/core/s2smanager.lua	Fri Oct 24 18:13:54 2008 +0100
+++ b/core/s2smanager.lua	Fri Oct 24 18:14:40 2008 +0100
@@ -179,4 +179,18 @@
 	end
 end
 
+function destroy_session(session)
+	(session.log or log)("info", "Destroying session");
+	if session.direction == "outgoing" then
+		hosts[session.to_host] = nil;
+	end
+	session.conn = nil;
+	session.disconnect = nil;
+	for k in pairs(session) do
+		if k ~= "trace" then
+			session[k] = nil;
+		end
+	end
+end
+
 return _M;
\ No newline at end of file