From c43583a23ae0e552779148236f973d20275f9bd0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 28 Aug 2012 10:02:10 +0000 Subject: fix for own crash caused by curve refactor, now curve tables are initialized once when the tree is initialized. thanks to Antony Riakiotakis for providing a fix, though this works a little different. --- source/blender/blenkernel/intern/colortools.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/colortools.c') diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 7c03c75bd99..d65c81b4f9b 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -105,9 +105,18 @@ void curvemapping_free_data(CurveMapping *cumap) int a; for (a = 0; a < CM_TOT; a++) { - if (cumap->cm[a].curve) MEM_freeN(cumap->cm[a].curve); - if (cumap->cm[a].table) MEM_freeN(cumap->cm[a].table); - if (cumap->cm[a].premultable) MEM_freeN(cumap->cm[a].premultable); + if (cumap->cm[a].curve) { + MEM_freeN(cumap->cm[a].curve); + cumap->cm[a].curve = NULL; + } + if (cumap->cm[a].table) { + MEM_freeN(cumap->cm[a].table); + cumap->cm[a].table = NULL; + } + if (cumap->cm[a].premultable) { + MEM_freeN(cumap->cm[a].premultable); + cumap->cm[a].premultable = NULL; + } } } -- cgit v1.2.3