forked from bartvdbraak/blender
Render Preview: Fix ID freeing in wrong function
This commit is contained in:
parent
a1689fb091
commit
e361e9e99c
@ -1146,15 +1146,6 @@ static void icon_preview_endjob(void *customdata)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ip->id_copy) {
|
|
||||||
/* Feels a bit hacky just to reuse shader_preview_free() */
|
|
||||||
ShaderPreview *sp = MEM_callocN(sizeof(ShaderPreview), "Icon ShaderPreview");
|
|
||||||
sp->id_copy = ip->id_copy;
|
|
||||||
sp->own_id_copy = true;
|
|
||||||
shader_preview_free(sp);
|
|
||||||
ip->id_copy = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ip->owner) {
|
if (ip->owner) {
|
||||||
PreviewImage *prv_img = ip->owner;
|
PreviewImage *prv_img = ip->owner;
|
||||||
prv_img->tag &= ~PRV_TAG_DEFFERED_RENDERING;
|
prv_img->tag &= ~PRV_TAG_DEFFERED_RENDERING;
|
||||||
@ -1169,6 +1160,15 @@ static void icon_preview_free(void *customdata)
|
|||||||
{
|
{
|
||||||
IconPreview *ip = (IconPreview *)customdata;
|
IconPreview *ip = (IconPreview *)customdata;
|
||||||
|
|
||||||
|
if (ip->id_copy) {
|
||||||
|
/* Feels a bit hacky just to reuse shader_preview_free() */
|
||||||
|
ShaderPreview *sp = MEM_callocN(sizeof(ShaderPreview), "Icon ShaderPreview");
|
||||||
|
sp->id_copy = ip->id_copy;
|
||||||
|
sp->own_id_copy = true;
|
||||||
|
shader_preview_free(sp);
|
||||||
|
ip->id_copy = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
BLI_freelistN(&ip->sizes);
|
BLI_freelistN(&ip->sizes);
|
||||||
MEM_freeN(ip);
|
MEM_freeN(ip);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user