Fixed a crash due to invalid pointers to temporary scenes for stroke rendering.

Freestyle generates a temporary scene containing a number of stroke meshes to
achieve stroke rendering using the Blender internal renderer.  This temporary
scene may appear in the outliner and undergo user interaction when the stroke
rendering takes a long time.  The crash was due to the deletion of the scene
without taking care of references to the scene from screens, one of which was
the outliner.
This commit is contained in:
Tamito Kajiyama 2011-10-30 22:53:24 +00:00
parent e287e9d0c4
commit 12f2c06d34

@ -2333,7 +2333,7 @@ static void composite_freestyle_renders(Render *re, int sample)
}
/* releases temporary scenes and renders for Freestyle stroke rendering */
static void free_all_freestyle_renders(void)
static void free_all_freestyle_renders(Scene *scene)
{
Render *re1, *freestyle_render;
LinkData *link;
@ -2342,7 +2342,7 @@ static void free_all_freestyle_renders(void)
for (link = (LinkData *)re1->freestyle_renders.first; link; link = link->next) {
if (link->data) {
freestyle_render = (Render *)link->data;
free_libblock(&G.main->scene, freestyle_render->scene);
unlink_scene(G.main, freestyle_render->scene, scene);
RE_FreeRender(freestyle_render);
}
}
@ -2576,7 +2576,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
do_merge_fullsample(re, NULL);
}
free_all_freestyle_renders();
free_all_freestyle_renders(re->scene);
/* weak... the display callback wants an active renderlayer pointer... */
re->result->renlay= render_get_active_layer(re, re->result);