Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-11-08 09:00:46 +0300
committerCampbell Barton <campbell@blender.org>2022-11-08 09:00:46 +0300
commit8b151982fe6b9e9ed698282d4f1ab625de87c175 (patch)
tree2400bce9909015e063f58d67618d1e3ce9a8f3dc /release
parentfddcdcc20c5a2b761a2becccc0a07f5fd8d43e54 (diff)
parent642ff82f749dc480875e2047eb5e9a9227f59093 (diff)
Merge branch 'blender-v3.4-release'
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/rna_info.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py
index e2bbc4077a1..07daf7c55eb 100644
--- a/release/scripts/modules/rna_info.py
+++ b/release/scripts/modules/rna_info.py
@@ -286,7 +286,10 @@ class InfoPropertyRNA:
self.enum_pointer = 0
if self.type == "enum":
- items = tuple(rna_prop.enum_items)
+ # WARNING: don't convert to a tuple as this causes dynamically allocated enums to access freed memory
+ # since freeing the iterator may free the memory used to store the internal `EnumPropertyItem` array.
+ # To support this properly RNA would have to support owning the dynamically allocated memory.
+ items = rna_prop.enum_items
items_static = tuple(rna_prop.enum_items_static)
self.enum_items[:] = [(item.identifier, item.name, item.description) for item in items]
self.is_enum_flag = rna_prop.is_enum_flag
@@ -295,6 +298,7 @@ class InfoPropertyRNA:
item = (items_static or items)
if item:
self.enum_pointer = item[0].as_pointer()
+ del items, items_static, item
else:
self.is_enum_flag = False