[cheese] Do not call _init() functions inside CheeseWidget



commit 9c17a290af0ec0fa306d56a6c4292650b2da7031
Author: David King <amigadave amigadave com>
Date:   Wed Sep 28 14:10:14 2011 +0200

    Do not call _init() functions inside CheeseWidget
    
    GObject construction cannot fail, which is incompatible with calling
    _init() functions which can fail inside a constructor. Users of
    CheeseWidget must instead initialise the relevant toolkits (Clutter-GTK+
    and Gst-Clutter) themselves, and gracefully fail before
    cheese_widget_new() is called. Fixes the remainder of bug 654913 and
    also bug 660400.

 libcheese/cheese-widget.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/libcheese/cheese-widget.c b/libcheese/cheese-widget.c
index a2bac26..3ce7e86 100644
--- a/libcheese/cheese-widget.c
+++ b/libcheese/cheese-widget.c
@@ -385,9 +385,6 @@ cheese_widget_class_init (CheeseWidgetClass *klass)
   GObjectClass   *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-  gtk_clutter_init (NULL, NULL);
-  clutter_gst_init (NULL, NULL);
-
   object_class->finalize = cheese_widget_finalize;
 #if 0
   object_class->set_property = cheese_widget_set_property;
@@ -418,7 +415,9 @@ cheese_widget_class_init (CheeseWidgetClass *klass)
 /**
  * cheese_widget_new:
  *
- * Returns a new #CheeseWidget widget.
+ * Creates a new #CheeseWidget. Make sure that you call gtk_clutter_init() and
+ * clutter_gst_init(), and check for errors during initialization, before
+ * calling this function.
  *
  * Return value: a #CheeseWidget widget.
  **/



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