Depsgraph: Use threading guard in context.evaluated_depsgraph_get
This is a part of T65174.
This commit is contained in:
parent
c25164e16d
commit
27d5d3c2f8
Notes:
blender-bot
2023-02-14 09:24:53 +01:00
Referenced by issue #65174, Deadlock between python and DEG Referenced by issue #65174, Deadlock between python and DEG
|
@ -57,6 +57,10 @@ const EnumPropertyItem rna_enum_context_mode_items[] = {
|
|||
|
||||
#ifdef RNA_RUNTIME
|
||||
|
||||
# ifdef WITH_PYTHON
|
||||
# include "BPY_extern.h"
|
||||
# endif
|
||||
|
||||
# include "RE_engine.h"
|
||||
|
||||
static PointerRNA rna_Context_manager_get(PointerRNA *ptr)
|
||||
|
@ -200,7 +204,20 @@ static int rna_Context_mode_get(PointerRNA *ptr)
|
|||
|
||||
static struct Depsgraph *rna_Context_evaluated_depsgraph_get(bContext *C)
|
||||
{
|
||||
return CTX_data_evaluated_depsgraph(C);
|
||||
struct Depsgraph *depsgraph;
|
||||
|
||||
# ifdef WITH_PYTHON
|
||||
/* Allow drivers to be evaluated */
|
||||
BPy_BEGIN_ALLOW_THREADS;
|
||||
# endif
|
||||
|
||||
depsgraph = CTX_data_evaluated_depsgraph(C);
|
||||
|
||||
# ifdef WITH_PYTHON
|
||||
BPy_END_ALLOW_THREADS;
|
||||
# endif
|
||||
|
||||
return depsgraph;
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue