[gegl-gtk] examples: Fix buffer lifetime in vala example



commit 29d451ac9b3ac3c4a1064e2a7677a6def9b24031
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Tue Feb 4 02:56:09 2014 -0800

    examples: Fix buffer lifetime in vala example
    
    Add an extra scope to the vala example that will destroy the nodes
    and windows before Gegl.exit() is called. (fixes bug 723591)

 examples/vala/gegl-gtk-basic.vala |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/examples/vala/gegl-gtk-basic.vala b/examples/vala/gegl-gtk-basic.vala
index d48f49e..e6250b1 100644
--- a/examples/vala/gegl-gtk-basic.vala
+++ b/examples/vala/gegl-gtk-basic.vala
@@ -5,22 +5,25 @@ class Examples.Basic : GLib.Object {
         Gtk.init(ref args);
         Gegl.init(ref args);
 
-        var graph = new Gegl.Node();
-        var node = graph.create_child("gegl:load");
-        node.set_property("path", args[1]);
+        {
+            var graph = new Gegl.Node();
+            var node = graph.create_child("gegl:load");
+            node.set_property("path", args[1]);
 
-        var window = new Gtk.Window();
-        window.title = "GEGL GTK Basic Vala example";
-        window.set_default_size(300, 300);
-        window.destroy.connect(Gtk.main_quit);
+            var window = new Gtk.Window();
+            window.title = "GEGL GTK Basic Vala example";
+            window.set_default_size(300, 300);
+            window.destroy.connect(Gtk.main_quit);
 
-        var node_view = new GeglGtk.View();
-        node_view.set_node(node);
+            var node_view = new GeglGtk.View();
+            node_view.set_node(node);
 
-        window.add(node_view);
-        window.show_all();
+            window.add(node_view);
+            window.show_all();
+
+            Gtk.main();
+        }
 
-        Gtk.main();
         Gegl.exit();
         return 0;
     }


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