[Bf-blender-cvs] [79f09c6bf27] id-ensure-unique-memory-address: Minor fixes/cleanup.

Bastien Montagne noreply at git.blender.org
Fri Feb 21 16:48:23 CET 2020


Commit: 79f09c6bf275999ee9d0163fd6b79e5e32a21f48
Author: Bastien Montagne
Date:   Fri Feb 21 16:48:11 2020 +0100
Branches: id-ensure-unique-memory-address
https://developer.blender.org/rB79f09c6bf275999ee9d0163fd6b79e5e32a21f48

Minor fixes/cleanup.

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

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

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

diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c
index 78b45a58dca..35657cae382 100644
--- a/source/blender/blenkernel/intern/main.c
+++ b/source/blender/blenkernel/intern/main.c
@@ -268,11 +268,12 @@ void BKE_main_idmemhash_usefrom(Main *bmain_user, Main *bmain_src)
 bool BKE_main_idmemhash_register_id(Main *bmain, void *old_vmemh, ID *id)
 {
   BLI_assert(bmain->used_id_memhash != NULL);
+  BLI_assert(old_vmemh != id);
   void **val;
   if (!BLI_ghash_ensure_p(bmain->used_id_memhash, id, &val)) {
     if (old_vmemh != NULL) {
-      BLI_assert(BLI_ghash_haskey(bmain->used_id_memhash, old_vmemh));
       LinkNode **chain_hook = (LinkNode **)BLI_ghash_lookup_p(bmain->used_id_memhash, old_vmemh);
+      BLI_assert(chain_hook != NULL);
       if (*chain_hook == NULL) {
         /* That datablock only ever had one address so far, we need to initialize its addresses
          * history chain. */



More information about the Bf-blender-cvs mailing list