diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-07-10 05:05:56 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-07-10 05:05:56 +0400 |
commit | 3f34a88fc821281079712effdc1608169cc37980 (patch) | |
tree | 188faff26cc1819f24d32031d3e08f6663e70006 /source/blender/editors/render | |
parent | a3643ee3d67a823b328b60a0cf08b335be0e147c (diff) |
Fix #36075: editing shading nodes could still crash blender internal rendered
draw mode. This happens because it uses node data structures in threads, now
it does same as preview render, which is to immediately stop the render thread
when e.g. deleting nodes.
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 30 | ||||
-rw-r--r-- | source/blender/editors/render/render_preview.c | 2 |
2 files changed, 20 insertions, 12 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 7a2ece66ba4..350422c3e83 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -1141,7 +1141,7 @@ void render_view3d_draw(RenderEngine *engine, const bContext *C) RE_ReleaseResultImage(re); } -void ED_viewport_render_kill_jobs(const bContext *C) +void ED_viewport_render_kill_jobs(const bContext *C, bool free_database) { wmWindowManager *wm = CTX_wm_manager(C); Main *bmain = CTX_data_main(C); @@ -1172,17 +1172,23 @@ void ED_viewport_render_kill_jobs(const bContext *C) if (rv3d->render_engine) { /* free render database now before we change data, because * RE_Database_Free will also loop over blender data */ - char name[32]; - Render *re; - - sprintf(name, "View3dPreview %p", (void *)ar); - re = RE_GetRender(name); - - if (re) - RE_Database_Free(re); - - /* tag render engine to update entire database */ - rv3d->render_engine->update_flag |= RE_ENGINE_UPDATE_DATABASE; + if (free_database) { + char name[32]; + Render *re; + + sprintf(name, "View3dPreview %p", (void *)ar); + re = RE_GetRender(name); + + if (re) + RE_Database_Free(re); + + /* tag render engine to update entire database */ + rv3d->render_engine->update_flag |= RE_ENGINE_UPDATE_DATABASE; + } + else { + /* quick shader update */ + rv3d->render_engine->update_flag |= RE_ENGINE_UPDATE_MA; + } } } } diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 76fa79029fd..8da66c114d5 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -1180,5 +1180,7 @@ void ED_preview_kill_jobs(const struct bContext *C) wmWindowManager *wm = CTX_wm_manager(C); if (wm) WM_jobs_kill(wm, NULL, common_preview_startjob); + + ED_viewport_render_kill_jobs(C, false); } |