diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-20 22:55:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-20 22:55:41 +0400 |
commit | e2534eac8e9c949010286b67ab02a41d6c1ef6c8 (patch) | |
tree | a5f88cc6a27743b186f610bcdd14620767b8a720 /source/blender/editors/render/render_internal.c | |
parent | 5d97c93c08c6c781809af70de81c5b889970b616 (diff) |
fix [#36347] Blender crashes when clicking on 'render' in 'viewport shading'
Diffstat (limited to 'source/blender/editors/render/render_internal.c')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 3a6bd05df0b..d3818e1cac7 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -804,6 +804,11 @@ static bool render_view3d_get_rects(ARegion *ar, View3D *v3d, RegionView3D *rv3d return true; } +static bool render_view3d_is_valid(RenderPreview *rp) +{ + return (rp->rv3d->render_engine != NULL); +} + /* called by renderer, checks job value */ static int render_view3d_break(void *rpv) { @@ -813,8 +818,9 @@ static int render_view3d_break(void *rpv) return 1; /* during render, rv3d->engine can get freed */ - if (rp->rv3d->render_engine == NULL) + if (render_view3d_is_valid(rp) == false) { *rp->stop = 1; + } return *(rp->stop); } @@ -928,8 +934,11 @@ static void render_view3d_startjob(void *customdata, short *stop, short *do_upda RE_Database_Preprocess(re); /* conversion not completed, need to do it again */ - if (!rstats->convertdone) - rp->engine->job_update_flag |= PR_UPDATE_DATABASE; + if (!rstats->convertdone) { + if (render_view3d_is_valid(rp)) { + rp->engine->job_update_flag |= PR_UPDATE_DATABASE; + } + } // printf("dbase update\n"); } |