[gegl] buffer: keep tile-cache queue around if tiles have been leaked



commit ed48dc989d78bfa39ce150a1c4d657df3d1765ca
Author: Øyvind Kolås <pippin gimp org>
Date:   Sun Apr 14 23:32:28 2019 +0200

    buffer: keep tile-cache queue around if tiles have been leaked
    
    This permits succesful too-late freeing of tiles when a garbage collector
    finally disposes of tiles after gegl_exit() and internal leak sanity checks
    have been run. Thus avoiding the
    
    GLib-WARNING **: 23:25:34.774: corrupted double-linked list detected
    
    reported as part of issue #142.

 gegl/buffer/gegl-tile-handler-cache.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gegl/buffer/gegl-tile-handler-cache.c b/gegl/buffer/gegl-tile-handler-cache.c
index 4a13895c4..fde419908 100644
--- a/gegl/buffer/gegl-tile-handler-cache.c
+++ b/gegl/buffer/gegl-tile-handler-cache.c
@@ -1071,7 +1071,16 @@ gegl_tile_cache_destroy (void)
   g_signal_handlers_disconnect_by_func (gegl_buffer_config(),
                                         gegl_buffer_config_tile_cache_size_notify,
                                         NULL);
-
   g_warn_if_fail (g_queue_is_empty (&cache_queue));
-  g_queue_clear (&cache_queue);
+
+
+  if (g_queue_is_empty (&cache_queue))
+    {
+      g_queue_clear (&cache_queue);
+    }
+  else
+    {
+     /* we leak portions of the GQueue data structure when it is not empty,
+        permitting leaked tiles to still be unreffed correctly */
+    }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]