Fix T42943: Crash with multiple calls to rna_info.BuildRNAInfo()

Thanks to @nesse for the fix
This commit is contained in:
Campbell Barton 2014-12-18 14:29:24 +01:00
parent f0f1c7995b
commit 85f6fc501c
Notes: blender-bot 2023-02-14 09:42:35 +01:00
Referenced by issue #42943, Crashes occur when rna_info.BuildRNAInfo() is called multiple times
1 changed files with 6 additions and 0 deletions

View File

@ -487,6 +487,12 @@ def GetInfoOperatorRNA(bl_rna):
def BuildRNAInfo():
# needed on successive calls to prevent stale data access
for cls in (InfoStructRNA, InfoFunctionRNA, InfoOperatorRNA, InfoPropertyRNA):
cls.global_lookup.clear()
del cls
# Use for faster lookups
# use rna_struct.identifier as the key for each dict
rna_struct_dict = {} # store identifier:rna lookups