Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/mball.c')
-rw-r--r--source/blender/blenkernel/intern/mball.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index d7019aa8458..685cd35fc20 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -66,28 +66,13 @@
/* Functions */
-void BKE_mball_unlink(MetaBall *mb)
+/** Free (or release) any data used by this mball (does not free the mball itself). */
+void BKE_mball_free(MetaBall *mb)
{
- int a;
-
- for (a = 0; a < mb->totcol; a++) {
- if (mb->mat[a])
- id_us_min(&mb->mat[a]->id);
- mb->mat[a] = NULL;
- }
-}
+ BKE_animdata_free((ID *)mb, false);
+ MEM_SAFE_FREE(mb->mat);
-/* do not free mball itself */
-void BKE_mball_free(MetaBall *mb)
-{
- BKE_mball_unlink(mb);
-
- if (mb->adt) {
- BKE_animdata_free((ID *)mb);
- mb->adt = NULL;
- }
- if (mb->mat) MEM_freeN(mb->mat);
BLI_freelistN(&mb->elems);
if (mb->disp.first) BKE_displist_free(&mb->disp);
}