diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-16 04:18:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-16 07:17:45 +0300 |
commit | e125305af41a7360c52b9a38024b7e24fde06d70 (patch) | |
tree | 89670ef582473388c7c87fe42f4ae81f0a44132d /source/blender/makesrna/intern/makesrna.c | |
parent | be51d671b500e8b6881295778de7272a70504b71 (diff) |
Fix T86332: Error using lambda in annotations in Python 3.10
Callbacks used in `bpy.props` didn't hold a references to the functions
they used.
While this has been the case since early 2.5x it didn't cause any
problems as long as the class held a reference.
With Python 3.10 or when using `from __future__ import annotations`,
the annotations are no longer owned by the class once evaluated.
Resolve this by holding a reference in the module, which now supports
traverse & clear callbacks so the objects are visible to Python's
garbage collector.
Also refactor storage of Python data, moving from an array into a struct.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 1f887c2eec3..6940e475f39 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3989,7 +3989,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr case PROP_ENUM: { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; fprintf(f, - "\t%s, %s, %s, %s, %s, NULL, ", + "\t%s, %s, %s, %s, %s, ", rna_function_string(eprop->get), rna_function_string(eprop->set), rna_function_string(eprop->item_fn), |