From 49fe27ee46b4d9272957c21c13365db322ca8396 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 8 May 2018 14:21:02 +0200 Subject: Modifiers: sanitize/cleanup modifiers' copying & freeing code. Should also fix T55000: Crash with hooks and curves in Cycles render. --- source/blender/modifiers/intern/MOD_hook.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_hook.c') diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 80c029157f7..80f07f579cd 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -67,13 +67,6 @@ static void copyData(ModifierData *md, ModifierData *target) HookModifierData *hmd = (HookModifierData *) md; HookModifierData *thmd = (HookModifierData *) target; - if (thmd->curfalloff != NULL) { - curvemapping_free(thmd->curfalloff); - } - if (thmd->indexar != NULL) { - MEM_freeN(thmd->indexar); - } - modifier_copyData_generic(md, target); thmd->curfalloff = curvemapping_copy(hmd->curfalloff); @@ -99,7 +92,7 @@ static void freeData(ModifierData *md) curvemapping_free(hmd->curfalloff); - if (hmd->indexar) MEM_freeN(hmd->indexar); + MEM_SAFE_FREE(hmd->indexar); } static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams)) -- cgit v1.2.3