Commit: c05363e8895a8cd6daa2241706d357c47ed4a83e
Author: Julian Eisel
Date:   Wed Jul 27 21:05:44 2016 +0200
Branches: master
https://developer.blender.org/rBc05363e8895a8cd6daa2241706d357c47ed4a83e

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

===================================================================

M       source/blender/editors/space_view3d/space_view3d.c

===================================================================

diff --git a/source/blender/editors/space_view3d/space_view3d.c 
b/source/blender/editors/space_view3d/space_view3d.c
index 96dda65..a588ba7 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)) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to