Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2021-04-22 15:26:29 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-04-22 15:26:29 +0300
commitc3701e230353ee70cf6f880aa6c5a1a4ba2ab330 (patch)
tree287f094cccb7f41cc61a79803bce3accca51128c
parent8c146d5efc693e695f986e11a7e91b9508c6fee1 (diff)
parent0ba0d27d368422b29db42c09f0ef658ce5b1e604 (diff)
Merge branch 'blender-v2.93-release'
-rw-r--r--source/blender/sequencer/intern/image_cache.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c
index 290ee185865..089bb5a6bec 100644
--- a/source/blender/sequencer/intern/image_cache.c
+++ b/source/blender/sequencer/intern/image_cache.c
@@ -976,14 +976,34 @@ static void seq_cache_recycle_linked(Scene *scene, SeqCacheKey *base)
SeqCacheKey *next = base->link_next;
while (base) {
+ if (!BLI_ghash_haskey(cache->hash, base)) {
+ break; /* Key has already been removed from cache. */
+ }
+
SeqCacheKey *prev = base->link_prev;
+ if (prev != NULL && prev->link_next != base) {
+ /* Key has been removed and replaced and doesn't belong to this chain anymore. */
+ base->link_prev = NULL;
+ break;
+ }
+
BLI_ghash_remove(cache->hash, base, seq_cache_keyfree, seq_cache_valfree);
base = prev;
}
base = next;
while (base) {
+ if (!BLI_ghash_haskey(cache->hash, base)) {
+ break; /* Key has already been removed from cache. */
+ }
+
next = base->link_next;
+ if (next != NULL && next->link_prev != base) {
+ /* Key has been removed and replaced and doesn't belong to this chain anymore. */
+ base->link_next = NULL;
+ break;
+ }
+
BLI_ghash_remove(cache->hash, base, seq_cache_keyfree, seq_cache_valfree);
base = next;
}