From b1bb7d2ee06d13e95154d13a6e830b8b0f845cde Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 13 Jan 2014 18:42:40 +0600 Subject: Fix T38040: Crash after loading big image file in compositor Issue was caused by cache limitor removing viewer image buffer from the memory during compositing. Now made it so all viewer images are persistent in the memory. This solves the crash mentioned above and also makes it so render/compo results are never lost. Further tweaks are possible, but pretty much happy now, at least no stoppers for work are there. --- source/blender/imbuf/IMB_imbuf_types.h | 1 + source/blender/imbuf/intern/moviecache.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index d20130805c0..44cb7f1211e 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -150,6 +150,7 @@ typedef struct ImBuf { #define IB_MIPMAP_INVALID (1 << 2) /* image mipmaps are invalid, need recreate */ #define IB_RECT_INVALID (1 << 3) /* float buffer changed, needs recreation of byte rect */ #define IB_DISPLAY_BUFFER_INVALID (1 << 4) /* either float or byte buffer changed, need to re-calculate display buffers */ +#define IB_PERSISTENT (1 << 5) /* image buffer is persistent in the memory and should never be removed from the cache */ /** * \name Imbuf Component flags diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c index 3718cb270c9..00d9dd2fe04 100644 --- a/source/blender/imbuf/intern/moviecache.c +++ b/source/blender/imbuf/intern/moviecache.c @@ -262,7 +262,9 @@ static bool get_item_destroyable(void *item_v) * * Such buffers are never to be freed. */ - if (item->ibuf->userflags & IB_BITMAPDIRTY) { + if ((item->ibuf->userflags & IB_BITMAPDIRTY) || + (item->ibuf->userflags & IB_PERSISTENT)) + { return false; } return true; -- cgit v1.2.3