[gnumeric] GUI: Plug leak.



commit c0feeaa879c03ffddf6138a0602bc3642c912594
Author: Morten Welinder <terra gnome org>
Date:   Tue Apr 16 13:24:48 2013 -0400

    GUI: Plug leak.
    
    dialog_so_styled takes ownership of the default style, so free it in the
    case where we already have the dialog shown.

 src/dialogs/ChangeLog          |  4 ++++
 src/dialogs/dialog-so-styled.c | 13 ++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index e4e2452..39d4963 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-16  Morten Welinder  <terra gnome org>
+
+       * dialog-so-styled.c (dialog_so_styled): Plug leak.
+
 2013-04-05  Morten Welinder  <terra gnome org>
 
        * dialog-tabulate.c (get_grid_float_entry): Get child at the right
diff --git a/src/dialogs/dialog-so-styled.c b/src/dialogs/dialog-so-styled.c
index 13d97e3..d5b96a6 100644
--- a/src/dialogs/dialog-so-styled.c
+++ b/src/dialogs/dialog-so-styled.c
@@ -131,18 +131,21 @@ dialog_so_styled (WBCGtk *wbcg,
        GtkWidget       *dialog, *help, *editor;
 
        /* Only pop up one copy per workbook */
-       if (gnumeric_dialog_raise_if_exists (wbcg, GNM_SO_STYLED_KEY))
+       if (gnumeric_dialog_raise_if_exists (wbcg, GNM_SO_STYLED_KEY)) {
+               g_object_unref (default_style);
                return;
+       }
 
        state = g_new0 (DialogSOStyled, 1);
        state->so    = G_OBJECT (so);
        state->wbcg  = wbcg;
        state->orig_style = go_style_dup (orig);
        state->orig_text = NULL;
-       dialog = gtk_dialog_new_with_buttons (title,
-               wbcg_toplevel (state->wbcg),
-               GTK_DIALOG_DESTROY_WITH_PARENT,
-               NULL, NULL);
+       dialog = gtk_dialog_new_with_buttons
+               (title,
+                wbcg_toplevel (state->wbcg),
+                GTK_DIALOG_DESTROY_WITH_PARENT,
+                NULL, NULL);
 
        gnm_dialog_setup_destroy_handlers (GTK_DIALOG (dialog),
                                           state->wbcg,


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