소스 검색

fix incomplete clean-up in threadbased session

wangweimin 3 년 전
부모
커밋
06217af6e2
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      pywebio/session/threadbased.py

+ 3 - 0
pywebio/session/threadbased.py

@@ -183,6 +183,9 @@ class ThreadBasedSession(Session):
             # so the `get_current_session()` call in those thread will raise SessionNotFoundException
             del cls.thread2session[id(t)]
 
+        if self.callback_thread:
+            del cls.thread2session[id(self.callback_thread)]
+
         def try_best_to_add_item_to_mq(mq, item, try_count=10):
             for _ in range(try_count):
                 try: