[Bf-blender-cvs] [ae9d2763529] undo-experiments: undoexp: do not clear icon_id of re-used IDs.

Bastien Montagne noreply at git.blender.org
Mon Dec 30 18:00:48 CET 2019


Commit: ae9d276352914b9f9f83195b84f5924eb472e50e
Author: Bastien Montagne
Date:   Mon Dec 30 17:58:27 2019 +0100
Branches: undo-experiments
https://developer.blender.org/rBae9d276352914b9f9f83195b84f5924eb472e50e

undoexp: do not clear icon_id of re-used IDs.

Those icon_id's remain valid, and allocated in the preview system,
clearing them here will lead to asserts...

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

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

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 43085480fff..467edb6cc33 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9461,7 +9461,7 @@ static BHead *read_libblock(FileData *fd,
           id->tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_NEW;
           id->lib = main->curlib;
           id->us = ID_FAKE_USERS(id);
-          id->icon_id = 0;
+          /* Do not reset id->icon_id here, memory allocated for it remains valid. */
           id->newid = NULL; /* Needed because .blend may have been saved with crap value here... */
           id->orig_id = NULL;



More information about the Bf-blender-cvs mailing list