[cheese] Fix leak of GtkSizeGroup in CheeseAvatarWidget



commit fd7ce9bb85059aa34e1d3f9c595e4d3a78a8326f
Author: David King <amigadave amigadave com>
Date:   Thu Nov 14 10:19:48 2013 +0000

    Fix leak of GtkSizeGroup in CheeseAvatarWidget

 libcheese/cheese-avatar-widget.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libcheese/cheese-avatar-widget.c b/libcheese/cheese-avatar-widget.c
index d8d75b6..d101cf3 100644
--- a/libcheese/cheese-avatar-widget.c
+++ b/libcheese/cheese-avatar-widget.c
@@ -63,6 +63,7 @@ struct _CheeseAvatarWidgetPrivate
   GtkWidget *image;
   GtkWidget *take_button;
   GtkWidget *take_again_button;
+  GtkSizeGroup *sizegroup;
   CheeseFlash *flash;
   gulong photo_taken_id;
 };
@@ -237,7 +238,6 @@ cheese_avatar_widget_init (CheeseAvatarWidget *widget)
 {
   GtkWidget *frame;
   GtkWidget *image;
-  GtkSizeGroup *sizegroup;
 
   CheeseAvatarWidgetPrivate *priv = widget->priv = CHEESE_AVATAR_WIDGET_GET_PRIVATE (widget);
 
@@ -277,9 +277,9 @@ cheese_avatar_widget_init (CheeseAvatarWidget *widget)
                             create_page (frame, priv->take_again_button),
                             gtk_label_new ("image"));
 
-  sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-  gtk_size_group_add_widget (sizegroup, priv->take_button);
-  gtk_size_group_add_widget (sizegroup, priv->take_again_button);
+  priv->sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+  gtk_size_group_add_widget (priv->sizegroup, priv->take_button);
+  gtk_size_group_add_widget (priv->sizegroup, priv->take_again_button);
 
   gtk_widget_show_all (GTK_WIDGET (widget));
 }
@@ -290,6 +290,7 @@ cheese_avatar_widget_finalize (GObject *object)
   CheeseAvatarWidgetPrivate *priv = ((CheeseAvatarWidget *) object)->priv;
 
   g_clear_object (&priv->flash);
+  g_clear_object (&priv->sizegroup);
 
   G_OBJECT_CLASS (cheese_avatar_widget_parent_class)->finalize (object);
 }


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