Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-08-31 17:42:14 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-08-31 17:48:27 +0300
commitbfd8da753d34881c6f1205938ce9e6e25e3bf4e8 (patch)
tree35227aeb458ef14d5dc40718fe262e6fd39a8b19 /source/blender/editors/render/render_preview.c
parent8fb9f2dbe9cb69476bf1f98c8503e5acd446c5b0 (diff)
Fix T49210: Issue with User Count on Images in some shader nodetrees when rendering previews
Our usercount handling was really... infuriating :| Here, localization (i.e. 'shalow' copy that should not touch to usercounts) was incrementing usercounts of the sole Textures IDs of lamps and worlds (on the weak and fallacious pretext that related BKE_free... functions would decrement those counts)... Seriously... So now, localize funcs do not increment any usercount anymore (since matching BKE_free... ones do not decrement any either), and we do not call anymore that stupid unlink when freeing temp localized copies of lamps/materials at end of preview generation. Note that we probably still have a lot to do to cleanup that copy/localize code, pretty sure we can dedpulicate a lot more.
Diffstat (limited to 'source/blender/editors/render/render_preview.c')
-rw-r--r--source/blender/editors/render/render_preview.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index b4f3426677a..ddbf59b2cf7 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -526,7 +526,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty
BKE_node_preview_init_tree(origwrld->nodetree, sp->sizex, sp->sizey, true);
}
}
-
+
return sce;
}
@@ -863,8 +863,6 @@ static void shader_preview_free(void *customdata)
/* get rid of copied world */
BLI_remlink(&pr_main->world, sp->worldcopy);
- /* T32865 - we need to unlink the texture copies, unlike for materials */
- BKE_libblock_relink_ex(pr_main, sp->worldcopy, NULL, NULL, true);
BKE_world_free(sp->worldcopy);
properties = IDP_GetProperties((ID *)sp->worldcopy, false);
@@ -881,7 +879,6 @@ static void shader_preview_free(void *customdata)
/* get rid of copied lamp */
BLI_remlink(&pr_main->lamp, sp->lampcopy);
- BKE_libblock_relink_ex(pr_main, sp->lampcopy, NULL, NULL, true);
BKE_lamp_free(sp->lampcopy);
properties = IDP_GetProperties((ID *)sp->lampcopy, false);