diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-06 16:07:12 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-06 16:09:39 +0300 |
commit | 0b07f9b71738c59b3834e2fc8b19779c72b3b020 (patch) | |
tree | 47c81a0946f76e72ec00587a8f9c0ac502360e53 /source/blender/blenkernel/intern | |
parent | 99feb10b8b2ed68cb2743d3ac3464717ff65f9bd (diff) |
Fix T78608: Memory leak in Material properties: "Data from SCE".
Caused by recent own refactor of cache presevation handling in readfile,
EEVEE's lightcache are weird birds that can also be saved in .blend
files, need a special handling for those 'persistent' caches...
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/volume.cc | 2 |
5 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 41ef5dc00ef..53e7037218e 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -195,24 +195,24 @@ static void image_foreach_cache(ID *id, .offset_in_ID = offsetof(Image, cache), .cache_v = image->cache, }; - function_callback(id, &key, (void **)&image->cache, user_data); + function_callback(id, &key, (void **)&image->cache, 0, user_data); for (int eye = 0; eye < 2; eye++) { for (int a = 0; a < TEXTARGET_COUNT; a++) { key.offset_in_ID = offsetof(Image, gputexture[a][eye]); key.cache_v = image->gputexture[a][eye]; - function_callback(id, &key, (void **)&image->gputexture[a][eye], user_data); + function_callback(id, &key, (void **)&image->gputexture[a][eye], 0, user_data); } } key.offset_in_ID = offsetof(Image, rr); key.cache_v = image->rr; - function_callback(id, &key, (void **)&image->rr, user_data); + function_callback(id, &key, (void **)&image->rr, 0, user_data); LISTBASE_FOREACH (RenderSlot *, slot, &image->renderslots) { key.offset_in_ID = (size_t)BLI_ghashutil_strhash_p(slot->name); key.cache_v = slot->render; - function_callback(id, &key, (void **)&slot->render, user_data); + function_callback(id, &key, (void **)&slot->render, 0, user_data); } } diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index d36f5ed0329..4a65c6ff5e7 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -139,11 +139,11 @@ static void movie_clip_foreach_cache(ID *id, .offset_in_ID = offsetof(MovieClip, cache), .cache_v = movie_clip->cache, }; - function_callback(id, &key, (void **)&movie_clip->cache, user_data); + function_callback(id, &key, (void **)&movie_clip->cache, 0, user_data); key.offset_in_ID = offsetof(MovieClip, tracking.camera.intrinsics); key.cache_v = movie_clip->tracking.camera.intrinsics; - function_callback(id, &key, (void **)&movie_clip->tracking.camera.intrinsics, user_data); + function_callback(id, &key, (void **)&movie_clip->tracking.camera.intrinsics, 0, user_data); } IDTypeInfo IDType_ID_MC = { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 7f3d6eb0372..a457d278e1d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -581,7 +581,11 @@ static void scene_foreach_cache(ID *id, .cache_v = scene->eevee.light_cache_data, }; - function_callback(id, &key, (void **)&scene->eevee.light_cache_data, user_data); + function_callback(id, + &key, + (void **)&scene->eevee.light_cache_data, + IDTYPE_CACHE_CB_FLAGS_PERSISTENT, + user_data); } IDTypeInfo IDType_ID_SCE = { diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 18fd8a10cc1..1fcfc9b060f 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -123,7 +123,7 @@ static void sound_foreach_cache(ID *id, .cache_v = sound->waveform, }; - function_callback(id, &key, &sound->waveform, user_data); + function_callback(id, &key, &sound->waveform, 0, user_data); } IDTypeInfo IDType_ID_SO = { diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc index 18859869b4e..48b920c8a05 100644 --- a/source/blender/blenkernel/intern/volume.cc +++ b/source/blender/blenkernel/intern/volume.cc @@ -494,7 +494,7 @@ static void volume_foreach_cache(ID *id, /* cache_v */ volume->runtime.grids, }; - function_callback(id, &key, (void **)&volume->runtime.grids, user_data); + function_callback(id, &key, (void **)&volume->runtime.grids, 0, user_data); } IDTypeInfo IDType_ID_VO = { |