Revert to master - those changes are globally valid, but remain incomplete,
[blender.git] / source / blender / blenkernel / intern / armature.c
index fc698f35b7110817ebffad1e378d7e65b8f515dd..6afe7f1abe906d862652536e1307871b5ca95b9e 100644 (file)
@@ -106,31 +106,30 @@ void BKE_armature_bonelist_free(ListBase *lb)
        BLI_freelistN(lb);
 }
 
-/**
- * Free (or release) any data used by this armature (does not free the armature itself).
- *
- * \param arm The armature to free.
- * \param do_id_user When \a true, ID datablocks used (referenced) by this armature are 'released'
- *                   (their user count is decreased).
- */
-void BKE_armature_free(bArmature *arm, const bool UNUSED(do_id_user))
+void BKE_armature_free(bArmature *arm)
 {
-       BKE_animdata_free(&arm->id);
+       if (arm) {
+               BKE_armature_bonelist_free(&arm->bonebase);
 
-       BKE_armature_bonelist_free(&arm->bonebase);
+               /* free editmode data */
+               if (arm->edbo) {
+                       BLI_freelistN(arm->edbo);
 
-       /* free editmode data */
-       if (arm->edbo) {
-               BLI_freelistN(arm->edbo);
+                       MEM_freeN(arm->edbo);
+                       arm->edbo = NULL;
+               }
 
-               MEM_freeN(arm->edbo);
-               arm->edbo = NULL;
-       }
+               /* free sketch */
+               if (arm->sketch) {
+                       freeSketch(arm->sketch);
+                       arm->sketch = NULL;
+               }
 
-       /* free sketch */
-       if (arm->sketch) {
-               freeSketch(arm->sketch);
-               arm->sketch = NULL;
+               /* free animation data */
+               if (arm->adt) {
+                       BKE_animdata_free(&arm->id);
+                       arm->adt = NULL;
+               }
        }
 }