[server/session] do not clear session.cnx if unrelated to cnx actually cleared
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 21 Jun 2013 16:07:45 +0200
changeset 9047 c873445fe198
parent 9046 6fb3f0106301
child 9048 8481fc6aa6dd
[server/session] do not clear session.cnx if unrelated to cnx actually cleared The cnx parameter may be different from the one actually loaded for the current thread. This will be possible in future commit when you close a client connection for example.
server/session.py
--- a/server/session.py	Mon Jun 24 14:55:26 2013 +0200
+++ b/server/session.py	Fri Jun 21 16:07:45 2013 +0200
@@ -1225,7 +1225,8 @@
     def _clear_thread_storage(self, cnx):
         self._cnxs.pop(cnx.connectionid, None)
         try:
-            del self.__threaddata.cnx
+            if self.__threaddata.cnx is cnx:
+                del self.__threaddata.cnx
         except AttributeError:
             pass