diff options
author | Weizhen Huang <itsnotrj@gmail.com> | 2022-11-11 18:17:58 +0300 |
---|---|---|
committer | Weizhen Huang <itsnotrj@gmail.com> | 2022-11-11 18:17:58 +0300 |
commit | dad3574a8c0b673efa9d7f7c890d9562e3f6a267 (patch) | |
tree | 84dff4a90c34a44744c329de21a999289f9d209a /release/scripts/modules/rna_info.py | |
parent | e9260afa93068d0181de6e3223f65e7bb016aecc (diff) | |
parent | dc8a1d38b73420428f9fb878386b99ebb69dd841 (diff) |
Merge branch 'master' into soc-2022-many-lights-sampling
Diffstat (limited to 'release/scripts/modules/rna_info.py')
-rw-r--r-- | release/scripts/modules/rna_info.py | 6 |
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 |