From 67a5d1b660a37a43f4d70fc7d588b67bef434574 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 10 Jun 2013 18:12:07 +0000 Subject: Follow up to r57354: WeightVG and Wave modifiers too need to handle tex id refcount ;) --- source/blender/modifiers/intern/MOD_weightvgedit.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/modifiers/intern/MOD_weightvgedit.c') diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index eee0856d69e..959e4d4f59d 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -43,6 +43,7 @@ #include "BKE_cdderivedmesh.h" #include "BKE_colortools.h" /* CurveMapping. */ #include "BKE_deform.h" +#include "BKE_library.h" #include "BKE_mesh.h" #include "BKE_modifier.h" #include "BKE_texture.h" /* Texture masking. */ @@ -77,6 +78,10 @@ static void freeData(ModifierData *md) { WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md; curvemapping_free(wmd->cmap_curve); + + if (wmd->mask_texture) { + id_us_min(&wmd->mask_texture->id); + } } static void copyData(ModifierData *md, ModifierData *target) @@ -102,6 +107,10 @@ static void copyData(ModifierData *md, ModifierData *target) twmd->mask_tex_mapping = wmd->mask_tex_mapping; twmd->mask_tex_map_obj = wmd->mask_tex_map_obj; BLI_strncpy(twmd->mask_tex_uvlayer_name, wmd->mask_tex_uvlayer_name, sizeof(twmd->mask_tex_uvlayer_name)); + + if (twmd->mask_texture) { + id_us_plus(&twmd->mask_texture->id); + } } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) -- cgit v1.2.3