From da50cd86a745c9e63fc645bad6f0a5412afff920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 9 Sep 2021 11:33:16 +0200 Subject: Cleanup: clarify comment about the use of `_PyThreadState_UncheckedGet()` No functional changes. --- source/blender/python/generic/bpy_threads.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/python') diff --git a/source/blender/python/generic/bpy_threads.c b/source/blender/python/generic/bpy_threads.c index bd707f728a1..57eb3a82c44 100644 --- a/source/blender/python/generic/bpy_threads.c +++ b/source/blender/python/generic/bpy_threads.c @@ -29,7 +29,9 @@ /* analogue of PyEval_SaveThread() */ BPy_ThreadStatePtr BPY_thread_save(void) { - /* The thread-state can be NULL when quitting Blender. */ + /* Use `_PyThreadState_UncheckedGet()`, instead of more canonical `PyGILState_Check()` or + * `PyThreadState_Get()`, to avoid a fatal error issued when a thread state is NULL (the thread + * state can be NULL when quitting Blender). */ if (_PyThreadState_UncheckedGet()) { return (BPy_ThreadStatePtr)PyEval_SaveThread(); } -- cgit v1.2.3