Fix T45496: Crash loading file during preview

Regression from multi-view
This commit is contained in:
Campbell Barton 2015-07-21 16:00:55 +10:00
parent 9eb6dcbb46
commit ae00011956
Notes: blender-bot 2023-02-14 08:52:10 +01:00
Referenced by issue #45511, GLSL error
Referenced by issue #45496, Blender 2.75a crashes after loading a .blend file dozen or more times (crash in preview code, still running while loading new file?)
1 changed files with 9 additions and 3 deletions

View File

@ -559,10 +559,16 @@ static bool ed_preview_draw_rect(ScrArea *sa, int split, int first, rcti *rect,
RE_AcquireResultImageViews(re, &rres);
/* material preview only needs monoscopy (view 0) */
rv = RE_RenderViewGetById(&rres, 0);
if (!BLI_listbase_is_empty(&rres.views)) {
/* material preview only needs monoscopy (view 0) */
rv = RE_RenderViewGetById(&rres, 0);
}
else {
/* possible the job clears the views but we're still drawing T45496 */
rv = NULL;
}
if (rv->rectf) {
if (rv && rv->rectf) {
if (ABS(rres.rectx - newx) < 2 && ABS(rres.recty - newy) < 2) {