[cheese/cheese-next] Check return value of gtk_clutter_init()



commit f38679c094e742499aad9f7195d607bfaee900c2
Author: Guido Trentalancia <guido trentalancia com>
Date:   Wed Sep 7 20:59:35 2011 +0200

    Check return value of gtk_clutter_init()
    
    Fixes bug 654913.

 src/cheese-main.vala        |    3 ++-
 tests/cheese-test-camera.c  |    3 ++-
 tests/cheese-test-chooser.c |    3 ++-
 tests/cheese-test-widget.c  |    3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/cheese-main.vala b/src/cheese-main.vala
index b154eca..a251a43 100644
--- a/src/cheese-main.vala
+++ b/src/cheese-main.vala
@@ -154,7 +154,8 @@ public class Cheese.Main : Gtk.Application
     Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
     Intl.textdomain (Config.GETTEXT_PACKAGE);
 
-    GtkClutter.init (ref args);
+    if (GtkClutter.init (ref args) != InitError.SUCCESS)
+      return 1;
 
     Cheese.Main app;
     app = new Cheese.Main ("org.gnome.Cheese", ApplicationFlags.FLAGS_NONE);
diff --git a/tests/cheese-test-camera.c b/tests/cheese-test-camera.c
index c64ad17..148c51f 100644
--- a/tests/cheese-test-camera.c
+++ b/tests/cheese-test-camera.c
@@ -42,7 +42,8 @@ main (int argc, char **argv)
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
 
-  gtk_clutter_init (&argc, &argv);
+  if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
diff --git a/tests/cheese-test-chooser.c b/tests/cheese-test-chooser.c
index 8996a87..506a853 100644
--- a/tests/cheese-test-chooser.c
+++ b/tests/cheese-test-chooser.c
@@ -35,7 +35,8 @@ main (int argc, char **argv)
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
 
-  gtk_clutter_init (&argc, &argv);
+  if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   window = cheese_avatar_chooser_new ();
   g_signal_connect (G_OBJECT (window), "response",
diff --git a/tests/cheese-test-widget.c b/tests/cheese-test-widget.c
index 5b502ee..3bc53c8 100644
--- a/tests/cheese-test-widget.c
+++ b/tests/cheese-test-widget.c
@@ -30,7 +30,8 @@ main (int argc, char **argv)
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
 
-  gtk_clutter_init (&argc, &argv);
+  if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
+    return 1;
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);



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