Merging r50248 through r50264 from trunk into soc-2011-tomato
[blender-staging.git] / source / blender / blenkernel / intern / colortools.c
index 5138d68cf790e75e1c646d48f49c1a9e3a724ce7..252add2c4233bbee3db482ec9c96045b9cc3e32b 100644 (file)
@@ -106,9 +106,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;
+               }
        }
 }