From ab30daf8b92e5ab9401f4826d52bbc9641ce6152 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 16 May 2007 12:05:15 +0000 Subject: [PATCH] if the invalided tile is the cached tile, release the cached tile. Fixes 2007-05-16 Sven Neumann * app/base/tile-manager.c (tile_invalidate): if the invalided tile is the cached tile, release the cached tile. Fixes bug #438802. svn path=/trunk/; revision=22507 --- ChangeLog | 5 +++++ app/base/tile-manager.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c19126486b..621d34ad9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-16 Sven Neumann + + * app/base/tile-manager.c (tile_invalidate): if the invalided tile + is the cached tile, release the cached tile. Fixes bug #438802. + 2007-05-16 Sven Neumann * app/widgets/gimpfiledialog.c (gimp_file_dialog_set_sensitive): diff --git a/app/base/tile-manager.c b/app/base/tile-manager.c index 869b75404c..599e8ea858 100644 --- a/app/base/tile-manager.c +++ b/app/base/tile-manager.c @@ -328,6 +328,14 @@ tile_invalidate (Tile **tile_ptr, if (! tile->valid) return; + if (tile_num == tm->cached_num) + { + tile_release (tm->cached_tile, FALSE); + + tm->cached_tile = NULL; + tm->cached_num = -1; + } + if (G_UNLIKELY (tile->share_count > 1)) { /* This tile is shared. Replace it with a new, invalid tile. */ @@ -815,7 +823,7 @@ read_pixel_data_1 (TileManager *tm, if (tm->cached_tile) tile_release (tm->cached_tile, FALSE); - tm->cached_num = num; + tm->cached_num = num; tm->cached_tile = tile_manager_get (tm, num, TRUE, FALSE); }