Added BKE_freestyle_lineset_delete() by generalizing FRS_delete_active_lineset().
[blender.git] / source / blender / freestyle / intern / blender_interface / FRS_freestyle.cpp
index b592c1152b199e1a5adf7429e374ded7af4b3ac6..a0e2fc906417b10577363f477e2c5aa2c4e5997b 100644 (file)
@@ -711,14 +711,7 @@ void FRS_delete_active_lineset(FreestyleConfig *config)
        FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
 
        if (lineset) {
-               if (lineset->group) {
-                       lineset->group->id.us--;
-               }
-               if (lineset->linestyle) {
-                       lineset->linestyle->id.us--;
-               }
-               BLI_remlink(&config->linesets, lineset);
-               MEM_freeN(lineset);
+               BKE_freestyle_lineset_delete(config, lineset);
                BKE_freestyle_lineset_set_active_index(config, 0);
        }
 }