Freestyle: fix crash unlinking object
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 26 Mar 2013 08:32:53 +0000 (08:32 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 26 Mar 2013 08:32:53 +0000 (08:32 +0000)
Was getting an address of pointer variable.

1  2 
source/blender/blenkernel/intern/object.c

index f3655e94eb0aa52ac43734fb5c07a2d1b522fe73,8d3e92975fef797201f97971a0b6d7e0fd9ebfd5..6f0f6a357bbb71a374d7365449283e8796f26029
@@@ -92,7 -92,6 +92,7 @@@
  #include "BKE_lamp.h"
  #include "BKE_lattice.h"
  #include "BKE_library.h"
 +#include "BKE_linestyle.h"
  #include "BKE_mesh.h"
  #include "BKE_tessmesh.h"
  #include "BKE_mball.h"
@@@ -426,8 -425,6 +426,8 @@@ void BKE_object_unlink(Object *ob
        World *wrld;
        bScreen *sc;
        Scene *sce;
 +      SceneRenderLayer *srl;
 +      FreestyleLineSet *lineset;
        Curve *cu;
        Tex *tex;
        Group *group;
                                }
                                SEQ_END
                        }
-                               for (lineset = (FreestyleLineSet *)&srl->freestyleConfig.linesets.first;
-                                    lineset; lineset = lineset->next) {
 +
 +                      for (srl= sce->r.layers.first; srl; srl= srl->next) {
++                              for (lineset = (FreestyleLineSet *)srl->freestyleConfig.linesets.first;
++                                   lineset; lineset = lineset->next)
++                              {
 +                                      BKE_unlink_linestyle_target_object(lineset->linestyle, ob);
 +                              }
 +                      }
                }
  
                sce = sce->id.next;