new inernal function which removes all tiles from a given drawable from

2004-02-16  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimptile.[ch] (_gimp_tile_cache_flush_drawable): new
	inernal function which removes all tiles from a given drawable
	from the cache.

	* libgimp/gimpdrawable.c (gimp_drawable_detach): call the new
	function before freeing the tiles. Fixes bug #134562.
This commit is contained in:
Michael Natterer 2004-02-16 21:57:01 +00:00 committed by Michael Natterer
parent de483e6b67
commit 1434675850
4 changed files with 37 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2004-02-16 Michael Natterer <mitch@gimp.org>
* libgimp/gimptile.[ch] (_gimp_tile_cache_flush_drawable): new
inernal function which removes all tiles from a given drawable
from the cache.
* libgimp/gimpdrawable.c (gimp_drawable_detach): call the new
function before freeing the tiles. Fixes bug #134562.
2004-02-16 Michael Natterer <mitch@gimp.org>
* libgimp/gimppixelrgn.c: cleaned up a bit: added missing

View file

@ -61,6 +61,9 @@ gimp_drawable_detach (GimpDrawable *drawable)
gimp_drawable_flush (drawable);
/* nuke all references to this drawable from the cache */
_gimp_tile_cache_flush_drawable (drawable);
if (drawable->tiles)
g_free (drawable->tiles);
if (drawable->shadow_tiles)

View file

@ -155,6 +155,25 @@ gimp_tile_cache_ntiles (gulong ntiles)
gimp_tile_height () * 4 + 1023) / 1024);
}
void
_gimp_tile_cache_flush_drawable (GimpDrawable *drawable)
{
GList *list;
g_return_if_fail (drawable != NULL);
list = tile_list_head;
while (list)
{
GimpTile *tile = list->data;
list = list->next;
if (tile->drawable == drawable)
gimp_tile_cache_flush (tile);
}
}
/* private functions */

View file

@ -46,10 +46,16 @@ void gimp_tile_ref_zero (GimpTile *tile);
void gimp_tile_unref (GimpTile *tile,
gboolean dirty);
void gimp_tile_flush (GimpTile *tile);
void gimp_tile_cache_size (gulong kilobytes);
void gimp_tile_cache_ntiles (gulong ntiles);
/* private function */
void _gimp_tile_cache_flush_drawable (GimpDrawable *drawable);
G_END_DECLS
#endif /* __GIMP_TILE_H__ */