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:
authorBastien Montagne <montagne29@wanadoo.fr>2013-06-10 22:12:07 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-06-10 22:12:07 +0400
commit67a5d1b660a37a43f4d70fc7d588b67bef434574 (patch)
tree509b19645a58de73e8ee9ae6c16342dfaa6155ba /source/blender/modifiers/intern/MOD_wave.c
parent5183ba74a84d1d41561f233bc1679d5a4fd422cb (diff)
Follow up to r57354: WeightVG and Wave modifiers too need to handle tex id refcount ;)
Diffstat (limited to 'source/blender/modifiers/intern/MOD_wave.c')
-rw-r--r--source/blender/modifiers/intern/MOD_wave.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c
index bf5f9fb6ae9..8c6c483472e 100644
--- a/source/blender/modifiers/intern/MOD_wave.c
+++ b/source/blender/modifiers/intern/MOD_wave.c
@@ -43,9 +43,10 @@
#include "BLI_string.h"
+#include "BKE_deform.h"
#include "BKE_DerivedMesh.h"
+#include "BKE_library.h"
#include "BKE_object.h"
-#include "BKE_deform.h"
#include "BKE_scene.h"
#include "depsgraph_private.h"
@@ -77,6 +78,14 @@ static void initData(ModifierData *md)
wmd->defgrp_name[0] = 0;
}
+static void freeData(ModifierData *md)
+{
+ WaveModifierData *wmd = (WaveModifierData *) md;
+ if (wmd->texture) {
+ id_us_min(&wmd->texture->id);
+ }
+}
+
static void copyData(ModifierData *md, ModifierData *target)
{
WaveModifierData *wmd = (WaveModifierData *) md;
@@ -98,6 +107,10 @@ static void copyData(ModifierData *md, ModifierData *target)
twmd->map_object = wmd->map_object;
twmd->texmapping = wmd->texmapping;
BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, sizeof(twmd->defgrp_name));
+
+ if (twmd->texture) {
+ id_us_plus(&twmd->texture->id);
+ }
}
static bool dependsOnTime(ModifierData *UNUSED(md))
@@ -378,7 +391,7 @@ ModifierTypeInfo modifierType_Wave = {
/* applyModifierEM */ NULL,
/* initData */ initData,
/* requiredDataMask */ requiredDataMask,
- /* freeData */ NULL,
+ /* freeData */ freeData,
/* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime,