mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
stdpy: protect against thread error when interpreter shuts down
This commit is contained in:
parent
1dc02f6a28
commit
c66b4792d7
@ -221,6 +221,10 @@ def _get_thread_locals(thread, i):
|
||||
def _remove_thread_id(threadId):
|
||||
""" Removes the thread with the indicated ID from the thread list. """
|
||||
|
||||
# On interpreter shutdown, Python may set module globals to None.
|
||||
if _threadsLock is None or _threads is None:
|
||||
return
|
||||
|
||||
_threadsLock.acquire()
|
||||
try:
|
||||
thread, locals, wrapper = _threads[threadId]
|
||||
|
Loading…
x
Reference in New Issue
Block a user