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.
This commit is contained in:
Bastien Montagne
2019-09-09 17:28:15 +02:00
parent e781e9565d
commit 22d157d469

View File

@@ -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)