diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-09-09 12:33:16 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-09-09 15:27:33 +0300 |
commit | da50cd86a745c9e63fc645bad6f0a5412afff920 (patch) | |
tree | 281b8304c2118c39cf90552900def85be71e68b9 /source/blender/python/generic | |
parent | bf47fb40fd6f0ee9386e9936cf213a1049c55b61 (diff) |
Cleanup: clarify comment about the use of `_PyThreadState_UncheckedGet()`
No functional changes.
Diffstat (limited to 'source/blender/python/generic')
-rw-r--r-- | source/blender/python/generic/bpy_threads.c | 4 |
1 files changed, 3 insertions, 1 deletions
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(); } |