[gegl] Don't crash on gegl_exit() if called without gegl_init(), warn instead



commit 25f4ced5f0c0ca8695bc3186ba277261c9be17b1
Author: Jon Nordby <jononor gmail com>
Date:   Wed Aug 1 13:58:07 2012 +0200

    Don't crash on gegl_exit() if called without gegl_init(), warn instead

 gegl/gegl-init.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index f2fe078..89c8b2f 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -346,6 +346,12 @@ void gegl_tile_storage_cache_cleanup (void);
 void
 gegl_exit (void)
 {
+  if (!config)
+    {
+      g_warning("gegl_exit() called without matching call to gegl_init()");
+      return;
+    }
+
   glong timing = gegl_ticks ();
 
   gegl_tile_storage_cache_cleanup ();



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