[Bf-blender-cvs] [9ef7759bf03] master: Fix (unreported) bad user refcounting of viewer image ID.

Bastien Montagne noreply at git.blender.org
Wed Mar 11 16:52:59 CET 2020


Commit: 9ef7759bf030344d4d44c0ac75c706ce40b98d04
Author: Bastien Montagne
Date:   Wed Mar 11 16:51:53 2020 +0100
Branches: master
https://developer.blender.org/rB9ef7759bf030344d4d44c0ac75c706ce40b98d04

Fix (unreported) bad user refcounting of viewer image ID.

This is typical case where you do not want to use actual ID refcounting,
but only the shallow 'user real' (aka 'user one') system...

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

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

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

diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 7a697f19b8b..4220408749a 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -3023,7 +3023,7 @@ Image *BKE_image_ensure_viewer(Main *bmain, int type, const char *name)
 
   /* happens on reload, imagewindow cannot be image user when hidden*/
   if (ima->id.us == 0) {
-    id_us_plus(&ima->id);
+    id_us_ensure_real(&ima->id);
   }
 
   return ima;



More information about the Bf-blender-cvs mailing list