[Bf-blender-cvs] [22d157d469d] master: I18n: dirty workaround for PITA ghost classes remaining after unregister.
Bastien Montagne
noreply at git.blender.org
Mon Sep 9 17:42:54 CEST 2019
Commit: 22d157d469de3d8712a7922bb40f109bf420fbe8
Author: Bastien Montagne
Date: Mon Sep 9 17:28:15 2019 +0200
Branches: master
https://developer.blender.org/rB22d157d469de3d8712a7922bb40f109bf420fbe8
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.
===================================================================
M release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
===================================================================
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)
More information about the Bf-blender-cvs
mailing list