[Bf-blender-cvs] [f73dad211b1] master: Potential fix for T81963: Random crashes in liboverride code.

Bastien Montagne noreply at git.blender.org
Thu Oct 22 15:23:06 CEST 2020


Commit: f73dad211b1dcb94aa83d7447a1a7d1d3ea641c1
Author: Bastien Montagne
Date:   Thu Oct 22 15:20:04 2020 +0200
Branches: master
https://developer.blender.org/rBf73dad211b1dcb94aa83d7447a1a7d1d3ea641c1

Potential fix for T81963: Random crashes in liboverride code.

>From the backtrace it looks like in some cases file save (which triggers
a general override updates) is done before other code has a chance to
re-generate pose data, leading to rna accessing freed memory.

I was never able to reproduce that here, so this is a tentative fix in
master, if it proves to be working for the studio it will be
cherry-picked into 2.91 release branch later.

===================================================================

M	source/blender/blenkernel/intern/lib_override.c

===================================================================

diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index e008058ae39..3bac0cf6289 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -1422,6 +1422,15 @@ void BKE_lib_override_library_main_operations_create(Main *bmain, const bool for
   FOREACH_MAIN_ID_BEGIN (bmain, id) {
     if (ID_IS_OVERRIDE_LIBRARY_REAL(id) &&
         (force_auto || (id->tag & LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH))) {
+      /* Usual issue with pose, it's quiet rare but sometimes they may not be up to date when this
+       * function is called. */
+      if (GS(id->name) == ID_OB) {
+        Object *ob = (Object *)id;
+        if (ob->type == OB_ARMATURE) {
+          BLI_assert(ob->data != NULL);
+          BKE_pose_ensure(bmain, ob, ob->data, true);
+        }
+      }
       /* Only check overrides if we do have the real reference data available, and not some empty
        * 'placeholder' for missing data (broken links). */
       if ((id->override_library->reference->tag & LIB_TAG_MISSING) == 0) {



More information about the Bf-blender-cvs mailing list