[balsa/gtk4: 102/248] misc: Do not leak the GtkSizeGroup




commit 747ead45a7b26c2285c5c38d88a0706129d54d55
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Aug 30 14:01:30 2020 -0400

    misc: Do not leak the GtkSizeGroup
    
    Also fix indentation in both files.
    
    modified:   libbalsa/misc.c
    modified:   libbalsa/misc.h

 libbalsa/misc.c | 6 +++---
 libbalsa/misc.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libbalsa/misc.c b/libbalsa/misc.c
index 93fca39e0..d7a108fe3 100644
--- a/libbalsa/misc.c
+++ b/libbalsa/misc.c
@@ -1283,8 +1283,8 @@ libbalsa_parser_options(void)
 
 GtkWidget *
 libbalsa_add_mnemonic_button_to_box(const gchar *markup,
-                           GtkWidget   *box,
-                           GtkAlign     align)
+                                    GtkWidget   *box,
+                                    GtkAlign     align)
 {
     GtkSizeGroup *size_group;
     GtkWidget *label;
@@ -1293,7 +1293,7 @@ libbalsa_add_mnemonic_button_to_box(const gchar *markup,
     size_group = g_object_get_data(G_OBJECT(box), LIBBALSA_SIZE_GROUP_KEY);
     if (size_group == NULL) {
         size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
-        g_object_set_data(G_OBJECT(box), LIBBALSA_SIZE_GROUP_KEY, size_group);
+        g_object_set_data_full(G_OBJECT(box), LIBBALSA_SIZE_GROUP_KEY, size_group, g_object_unref);
     }
 
     label = gtk_label_new(NULL);
diff --git a/libbalsa/misc.h b/libbalsa/misc.h
index a4983de09..93b9e3c22 100644
--- a/libbalsa/misc.h
+++ b/libbalsa/misc.h
@@ -164,8 +164,8 @@ void libbalsa_parser_options_init(void);
 GMimeParserOptions *libbalsa_parser_options(void);
 
 GtkWidget * libbalsa_add_mnemonic_button_to_box(const gchar *markup,
-                                       GtkWidget   *box,
-                                       GtkAlign     align);
+                                                GtkWidget   *box,
+                                                GtkAlign     align);
 
 
 #endif                         /* __LIBBALSA_MISC_H__ */


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