[gegl/soc-2012-ops] buffer: ref the added handlers in gegl_tile_handler_chain_add()
- From: Maxime Nicco <maxnicco src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/soc-2012-ops] buffer: ref the added handlers in gegl_tile_handler_chain_add()
- Date: Wed, 11 Jul 2012 18:29:31 +0000 (UTC)
commit 1a6689d01a511969d4202069f9eaf3063d813d01
Author: Michael Natterer <mitch gimp org>
Date: Tue Jul 3 13:04:12 2012 +0200
buffer: ref the added handlers in gegl_tile_handler_chain_add()
and unref them in the caller after adding it.
gegl/buffer/gegl-tile-handler-chain.c | 5 +++--
gegl/buffer/gegl-tile-storage.c | 17 +++++++++++------
2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/gegl/buffer/gegl-tile-handler-chain.c b/gegl/buffer/gegl-tile-handler-chain.c
index bc847a9..85f1890 100644
--- a/gegl/buffer/gegl-tile-handler-chain.c
+++ b/gegl/buffer/gegl-tile-handler-chain.c
@@ -164,8 +164,9 @@ GeglTileHandler *
gegl_tile_handler_chain_add (GeglTileHandlerChain *tile_handler_chain,
GeglTileHandler *handler)
{
- tile_handler_chain->chain = g_slist_prepend (tile_handler_chain->chain, handler);
- /*gegl_tile_handler_chain_bind (tile_handler_chain);*/
+ tile_handler_chain->chain = g_slist_prepend (tile_handler_chain->chain,
+ g_object_ref (handler));
+
return handler;
}
diff --git a/gegl/buffer/gegl-tile-storage.c b/gegl/buffer/gegl-tile-storage.c
index 6120aba..8b7514b 100644
--- a/gegl/buffer/gegl-tile-storage.c
+++ b/gegl/buffer/gegl-tile-storage.c
@@ -115,10 +115,10 @@ gegl_tile_storage_new (GeglTileBackend *backend)
if (g_getenv("GEGL_LOG_TILE_BACKEND")||
g_getenv("GEGL_TILE_LOG"))
gegl_tile_handler_chain_add (tile_handler_chain,
- g_object_new (GEGL_TYPE_TILE_HANDLER_LOG, NULL));
+ g_object_new (GEGL_TYPE_TILE_HANDLER_LOG, NULL));
#endif
- cache = g_object_new (GEGL_TYPE_TILE_HANDLER_CACHE, NULL);
+ cache = gegl_tile_handler_cache_new ();
empty = gegl_tile_handler_empty_new (backend, cache);
zoom = gegl_tile_handler_zoom_new (backend, tile_storage, cache);
@@ -126,11 +126,16 @@ gegl_tile_storage_new (GeglTileBackend *backend)
gegl_tile_handler_chain_add (tile_handler_chain, zoom);
gegl_tile_handler_chain_add (tile_handler_chain, empty);
+ g_object_unref (cache);
+ g_object_unref (zoom);
+ g_object_unref (empty);
+
#if 0
if (g_getenv("GEGL_LOG_TILE_CACHE"))
gegl_tile_handler_chain_add (tile_handler_chain,
g_object_new (GEGL_TYPE_TILE_HANDLER_LOG, NULL));
#endif
+
tile_storage->cache = cache;
cache->tile_storage = tile_storage;
gegl_tile_handler_chain_bind (tile_handler_chain);
@@ -139,10 +144,10 @@ gegl_tile_storage_new (GeglTileBackend *backend)
tile_storage;
tile_storage->idle_swapper = g_timeout_add_full (G_PRIORITY_LOW,
- 250,
- tile_storage_idle,
- tile_storage,
- NULL);
+ 250,
+ tile_storage_idle,
+ tile_storage,
+ NULL);
return tile_storage;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]