Fix T75675: Unlinking [with setting users to zero] not clearing

LIB_TAG_EXTRAUSER_SET flag

For example in the Image Editor, an assert would be triggered after
unlinking an image [with setting users to zero] and then setting the
image for the Image Editor again.

Whenever we set an Image for Image Editor, the Image ID is flagged
LIB_TAG_EXTRAUSER_SET, when we unlink [with setting users to zero] this
flag was not cleared.

quote @mont29: "a proper fix would be to move this to modern code, and
actually delete the ID..." but that is for later.

Maniphest Tasks: T75675

Differential Revision: https://developer.blender.org/D7452
This commit is contained in:
Philipp Oeser 2020-04-16 17:09:04 +02:00
parent e9bf624a49
commit 8cb10c124e
Notes: blender-bot 2023-02-14 00:10:08 +01:00
Referenced by issue #75850, Liquid simulation, cache type "Replay", doesn't recognize objects created after Domain creation, doesn't update
Referenced by issue #75851, Liquid simulation, cache type "Modular", forgets effectors after "Stop" and "Resume"
Referenced by issue #75843, Blender 2.83 beta April 16,2020
Referenced by issue #75826, outline for selected bug
Referenced by issue #75827, Boolean operation generates additional edges
Referenced by issue #75807, crash sculpt mode in multires modify
Referenced by issue #75675, Image editor assert when image is unlinked [with setting users to zero]
1 changed files with 1 additions and 0 deletions

View File

@ -536,6 +536,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
if (id && CTX_wm_window(C)->eventstate->shift) {
/* only way to force-remove data (on save) */
id_us_clear_real(id);
id_fake_user_clear(id);
id->us = 0;
}