Merged changes in the trunk up to revision 49986.
[blender.git] / source / blender / blenkernel / intern / object.c
index 914e19bd1dcac45d3b6ae6efac03bbcbeb27ae3c..bc6cdc949eb55ba4df8c4beab99a8f7d61958416 100644 (file)
 
 #include "GPU_material.h"
 
 
 #include "GPU_material.h"
 
+#include "FRS_freestyle.h"
+
 /* Local function protos */
 float originmat[3][3];  /* after BKE_object_where_is_calc(), can be used in other functions (bad!) */
 
 /* Local function protos */
 float originmat[3][3];  /* after BKE_object_where_is_calc(), can be used in other functions (bad!) */
 
@@ -620,6 +622,14 @@ void BKE_object_unlink(Object *ob)
                                }
                                SEQ_END
                        }
                                }
                                SEQ_END
                        }
+
+                       {
+                               SceneRenderLayer *srl;
+
+                               for (srl= sce->r.layers.first; srl; srl= srl->next) {
+                                       FRS_unlink_target_object(&srl->freestyleConfig, ob);
+                               }
+                       }
                }
 
                sce = sce->id.next;
                }
 
                sce = sce->id.next;