From 22d157d469de3d8712a7922bb40f109bf420fbe8 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 9 Sep 2019 17:28:15 +0200 Subject: I18n: dirty workaround for PITA ghost classes remaining after unregister. Spent again a whole day trying to understand what happens here, with no luck. For some reasons, OperatorProperties children of unregistered operator classes remain accessible, with their `bl_rna` member, although that one is 100% invalid (freed memory, crashes with ASAN builds). Funny thing is, I cannot reproduce that situation when disabling the add-on from the py console of a Blender-with-UI. Note: issue revealed by X3D add-on, which is still enabled in factory settings, while not being officially supported any more, this has to be fixed in a separate commit. --- release/scripts/modules/bl_i18n_utils/bl_extract_messages.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py index fdd36589d4d..4aaa30a0508 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -838,7 +838,12 @@ def dump_messages(do_messages, do_checks, settings): # For now, enable all official addons, before extracting msgids. addons = utils.enable_addons(support={"OFFICIAL"}) # Note this is not needed if we have been started with factory settings, but just in case... - utils.enable_addons(support={"COMMUNITY", "TESTING"}, disable=True) + # XXX This is not working well, spent a whole day trying to understand *why* we still have references of + # those removed calsses in things like `bpy.types.OperatorProperties.__subclasses__()` + # (could not even reproduce it from regular py console in Blender with UI...). + # For some reasons, cleanup does not happen properly, *and* we have no way to tell which class is valid + # and which has been unregistered. So for now, just go for the dirty, easy way: do not disable add-ons. :( + # ~ utils.enable_addons(support={"COMMUNITY", "TESTING"}, disable=True) reports = _gen_reports(_gen_check_ctxt(settings) if do_checks else None) -- cgit v1.2.3