diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 10 |
2 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index c0211c53021..d2fa09fa9e9 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -176,6 +176,16 @@ void BKE_scene_layer_free(SceneLayer *sl) MEM_freeN(sl->properties_evaluated); } + for (SceneLayerEngineData *sled = sl->drawdata.first; sled; sled = sled->next) { + if (sled->storage) { + if (sled->free) { + sled->free(sled->storage); + } + MEM_freeN(sled->storage); + } + } + BLI_freelistN(&sl->drawdata); + MEM_SAFE_FREE(sl->stats); } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index dd23b61f148..c24a6d3c791 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -454,7 +454,15 @@ void BKE_object_free(Object *ob) } GPU_lamp_free(ob); - DRW_object_engine_data_free(ob); + for (ObjectEngineData *oed = ob->drawdata.first; oed; oed = oed->next) { + if (oed->storage) { + if (oed->free) { + oed->free(oed->storage); + } + MEM_freeN(oed->storage); + } + } + BLI_freelistN(&ob->drawdata); BKE_sculptsession_free(ob); |