[gegl] buffer: only flush non-internal tile backends in dispose
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: only flush non-internal tile backends in dispose
- Date: Thu, 15 Mar 2012 19:39:33 +0000 (UTC)
commit 6959dc15f198f9eee06fca85cfb565d3037da509
Author: Ãyvind KolÃs <pippin gimp org>
Date: Thu Mar 15 19:35:11 2012 +0000
buffer: only flush non-internal tile backends in dispose
This avoids walking the full tile cache on dispose of all internal buffers.
gegl/buffer/gegl-buffer.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer.c b/gegl/buffer/gegl-buffer.c
index 5575cec..9f683f8 100644
--- a/gegl/buffer/gegl-buffer.c
+++ b/gegl/buffer/gegl-buffer.c
@@ -53,6 +53,7 @@
#include "gegl-tile-storage.h"
#include "gegl-tile-backend.h"
#include "gegl-tile-backend-file.h"
+#include "gegl-tile-backend-tiledir.h"
#include "gegl-tile-backend-ram.h"
#include "gegl-tile.h"
#include "gegl-tile-handler-cache.h"
@@ -372,11 +373,18 @@ gegl_buffer_dispose (GObject *object)
GeglTileHandler *handler = GEGL_TILE_HANDLER (object);
gegl_buffer_sample_cleanup (buffer);
- gegl_buffer_flush (buffer);
if (handler->source &&
GEGL_IS_TILE_STORAGE (handler->source))
{
+ GeglTileBackend *backend = gegl_buffer_backend (buffer);
+
+ /* only flush non-internal backends,. */
+ if (!(GEGL_IS_TILE_BACKEND_FILE (backend) ||
+ GEGL_IS_TILE_BACKEND_RAM (backend) ||
+ GEGL_IS_TILE_BACKEND_TILE_DIR (backend)))
+ gegl_buffer_flush (buffer);
+
gegl_buffer_void (buffer);
#if 0
g_object_unref (handler->source);
@@ -743,6 +751,7 @@ gegl_buffer_get_tile (GeglTileSource *source,
gegl_tile_lock (tile);
tile->tile_storage = buffer->tile_storage;
gegl_tile_unlock (tile);
+ tile->rev--;
}
tile->x = x;
tile->y = y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]