[Bf-blender-cvs] [e40ad8ba622] undo-experiments-swap-reread-datablocks: undoexp: fix memleak after recent change of WM/SCR/WS IDs handling.

Bastien Montagne noreply at git.blender.org
Thu Jan 30 21:57:21 CET 2020


Commit: e40ad8ba6224974d2984f94bab4e3b4e7af39451
Author: Bastien Montagne
Date:   Thu Jan 30 15:11:09 2020 +0100
Branches: undo-experiments-swap-reread-datablocks
https://developer.blender.org/rBe40ad8ba6224974d2984f94bab4e3b4e7af39451

undoexp: fix memleak after recent change of WM/SCR/WS IDs handling.

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

M	source/blender/blenloader/intern/readfile.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b8f36b05c19..07f65c112fa 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9489,8 +9489,6 @@ static BHead *read_libblock(FileData *fd,
           can_finalize_and_return = true;
         }
         else if (id_old != NULL && fd->are_memchunks_identical) {
-          MEM_freeN(id);
-
           /* Do not add LIB_TAG_NEW here, this should not be needed/used in undo case anyway (as
            * this is only for do_version-like code), but for sake of consistency, and also because
            * it will tell us which ID is re-used from old Main, and which one is actually new. */
@@ -9526,6 +9524,7 @@ static BHead *read_libblock(FileData *fd,
             *r_id = id_old;
           }
 
+          MEM_freeN(id);
           oldnewmap_free_unused(fd->datamap);
           oldnewmap_clear(fd->datamap);



More information about the Bf-blender-cvs mailing list