[Bf-blender-cvs] [606f3c74d36] master: Fix T62643: ID user decrement error, likely related to custom material PointerProperty.

Bastien Montagne noreply at git.blender.org
Mon Mar 18 13:57:23 CET 2019


Commit: 606f3c74d36bbbe6b7e3aeae962176a89355a552
Author: Bastien Montagne
Date:   Mon Mar 18 13:55:26 2019 +0100
Branches: master
https://developer.blender.org/rB606f3c74d36bbbe6b7e3aeae962176a89355a552

Fix T62643: ID user decrement error, likely related to custom material PointerProperty.

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.

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

M	source/blender/editors/render/render_preview.c

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

diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 9599a7bdbee..0b0acbffec9 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -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)) {



More information about the Bf-blender-cvs mailing list