diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-07-27 22:05:44 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-07-27 22:05:44 +0300 |
commit | c05363e8895a8cd6daa2241706d357c47ed4a83e (patch) | |
tree | 107a1373bc748347ee74c9e670c495f51f541680 /source/blender/editors/space_view3d/space_view3d.c | |
parent | 4559229163a513541913ab1f20fbc440ac136658 (diff) |
Fix crash closing Blender while in rendered local view
Happens because it was always using regionbase of active/visible area, not the correct one of the (possibly inactive) 3D view. Was pretty hidden because you had to be in local view to trigger it.
Could also remove ScrArea * argument from SpaceType.id_remap now, but leaving in there to avoid bigger changes (might also be useful for some case).
Steps to reproduce:
* Default startup.blend
* Enter local view with default cube (/-key)
* Render (or open a different editor where the 3D View is)
* Close Blender - should invoke crash
Diffstat (limited to 'source/blender/editors/space_view3d/space_view3d.c')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 96dda65b81d..a588ba7221b 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1400,7 +1400,7 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes return -1; /* found but not available */ } -static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_id) +static void view3d_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id) { View3D *v3d; ARegion *ar; @@ -1414,7 +1414,8 @@ static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_i if ((ID *)v3d->camera == old_id) { v3d->camera = (Object *)new_id; if (!new_id) { - for (ar = sa->regionbase.first; ar; ar = ar->next) { + /* use v3d->regionbase as sa->regionbase is from active area, 3D view might be inactive though */ + for (ar = v3d->regionbase.first; ar; ar = ar->next) { if (ar->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = is_local ? ((RegionView3D *)ar->regiondata)->localvd : ar->regiondata; if (rv3d && (rv3d->persp == RV3D_CAMOB)) { |