Fix T62643: ID user decrement error, likely related to custom material PointerProperty.
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 18 Mar 2019 12:55:26 +0000 (13:55 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 18 Mar 2019 12:57:07 +0000 (13:57 +0100)
We are in a totally out-of-main context here, so no refcounting of any ID...

Note that this whole 'render preview' area could use some refactor with
modern ID management API, but that would go way beyond a mere bugfix,
and it is not the time to do such things.

source/blender/editors/render/render_preview.c

index 9599a7bdbeed55ad0a23f432ec6326ce182ff6c0..0b0acbffec961bb62f528ee3649546b83dd7382d 100644 (file)
@@ -61,6 +61,7 @@
 #include "BKE_idprop.h"
 #include "BKE_image.h"
 #include "BKE_icons.h"
+#include "BKE_library.h"
 #include "BKE_light.h"
 #include "BKE_layer.h"
 #include "BKE_main.h"
@@ -923,7 +924,7 @@ static void shader_preview_free(void *customdata)
                /* get rid of copied ID */
                properties = IDP_GetProperties(sp->id_copy, false);
                if (properties) {
-                       IDP_FreeProperty(properties);
+                       IDP_FreeProperty_ex(properties, false);
                        MEM_freeN(properties);
                }
                switch (GS(sp->id_copy->name)) {