[gegl] tests/simple: Don't call gegl_color_new until after gegl_init



commit bfb03d9b34b5607ff33ea688fc078b656672ffae
Author: Michael Henning <drawoc darkrefraction com>
Date:   Sun Aug 10 12:45:05 2014 -0400

    tests/simple: Don't call gegl_color_new until after gegl_init
    
    If you call gegl_color_new before gegl_init, it will now try to
    call babl before babl was initialized and segfault.

 tests/simple/test-node-properties.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/tests/simple/test-node-properties.c b/tests/simple/test-node-properties.c
index fd27413..3a72def 100644
--- a/tests/simple/test-node-properties.c
+++ b/tests/simple/test-node-properties.c
@@ -29,7 +29,7 @@ int main(int argc, char *argv[])
   int           result = SUCCESS;
   GeglNode     *graph  = NULL;
   GeglNode     *node   = NULL;
-  GeglColor    *color  = gegl_color_new ("rgb(0.0, 1.0, 0.0)");
+  GeglColor    *color  = NULL;
   double        x      = -5;
   double        y      = -5;
   char         *name   = NULL;
@@ -37,7 +37,9 @@ int main(int argc, char *argv[])
 
   /* Init */
   gegl_init (&argc, &argv);
-  
+
+  color = gegl_color_new ("rgb(0.0, 1.0, 0.0)");
+
   graph = gegl_node_new ();
   node  = gegl_node_new_child (graph,
                                "operation", "gegl:color",


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