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.
This commit is contained in:
Bastien Montagne 2019-03-18 13:55:26 +01:00
parent 2b79f274e3
commit 606f3c74d3
Notes: blender-bot 2023-02-14 11:42:40 +01:00
Referenced by issue #62643, ID user decrement error, likely related to custom material PointerProperty
1 changed files with 2 additions and 1 deletions

View 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)) {