[gnumeric] Plug leaks.



commit 4cad259ecbbddd65e16de6ee7635e048a6cebe22
Author: Morten Welinder <terra gnome org>
Date:   Sat Dec 6 11:05:41 2014 -0500

    Plug leaks.

 ChangeLog                         |    8 ++++++++
 src/command-context.c             |    2 ++
 src/sheet-control-gui.c           |    2 +-
 src/sheet.c                       |   32 +++++++++++++++-----------------
 src/widgets/ChangeLog             |    4 ++++
 src/widgets/gnumeric-expr-entry.c |    1 -
 6 files changed, 30 insertions(+), 19 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7361627..6999b63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-12-06  Morten Welinder  <terra gnome org>
+
+       * src/sheet.c (sheet_insert_rows, sheet_insert_cols): Plug leak.
+
+       * src/command-context.c (gnm_cmd_context_error_splits_array): Plug
+       leak.
+       (gnm_cmd_context_error_splits_merge): Plug leak.
+
 2014-11-15  Morten Welinder  <terra gnome org>
 
        * src/sheet-control-gui.c (scg_object_unselect): Avoid crashing if
diff --git a/src/command-context.c b/src/command-context.c
index 9ccc96f..f4d8522 100644
--- a/src/command-context.c
+++ b/src/command-context.c
@@ -58,6 +58,7 @@ gnm_cmd_context_error_splits_array (GOCmdContext *context,
                err = g_error_new (gnm_error_array(), 0,
                        _("Would split an array"));
        go_cmd_context_error (context, err);
+       g_error_free (err);
 }
 
 void
@@ -69,6 +70,7 @@ gnm_cmd_context_error_splits_merge (GOCmdContext *context,
                             _("Would split merge %s"),
                             range_as_string (merge));
        go_cmd_context_error (context, err);
+       g_error_free (err);
 }
 
 GQuark
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 8982cb7..39f424d 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -1653,7 +1653,7 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
 
                g_object_ref (scg->grid);
                scg->vpane = g_object_new (GTK_TYPE_PANED, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
-                       gtk_paned_add1 (scg->vpane, gtk_label_new (NULL)); /* use a spacer */
+               gtk_paned_add1 (scg->vpane, gtk_label_new (NULL)); /* use a spacer */
                gtk_paned_add2 (scg->vpane, scg->vs);
                scg_gtk_paned_set_position (scg, scg->vpane, 0);
                gtk_widget_set_vexpand (GTK_WIDGET (scg->vpane), TRUE);
diff --git a/src/sheet.c b/src/sheet.c
index fddd26a..49781de 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -5110,14 +5110,6 @@ sheet_insert_cols (Sheet *sheet, int col, int count,
        if (pundo) *pundo = NULL;
        schedule_reapply_filters (sheet, pundo);
 
-       if (pundo) {
-               int last = first + (count - 1);
-               GnmRange r;
-               range_init_cols (&r, sheet, first, last);
-               combine_undo (pundo, clipboard_copy_range_undo (sheet, &r));
-               states = colrow_get_states (sheet, TRUE, first, last);
-       }
-
        /* 0. Check displaced/deleted region and ensure arrays aren't divided. */
        /* We need to check at "col" and at "first".  If they coincide, just
           use the end.  */
@@ -5127,9 +5119,16 @@ sheet_insert_cols (Sheet *sheet, int col, int count,
                          : gnm_sheet_get_last_col (sheet)));
        if (sheet_range_splits_array (sheet, &region, NULL,
                                      cc, _("Insert Columns")))
-                       return TRUE;
+               return TRUE;
 
        /* 1. Delete all columns (and their cells) that will fall off the end */
+       if (pundo) {
+               int last = first + (count - 1);
+               GnmRange r;
+               range_init_cols (&r, sheet, first, last);
+               combine_undo (pundo, clipboard_copy_range_undo (sheet, &r));
+               states = colrow_get_states (sheet, TRUE, first, last);
+       }
        for (i = sheet->cols.max_used; i >= gnm_sheet_get_max_cols (sheet) - count ; --i)
                sheet_col_destroy (sheet, i, TRUE);
 
@@ -5282,14 +5281,6 @@ sheet_insert_rows (Sheet *sheet, int row, int count,
        if (pundo) *pundo = NULL;
        schedule_reapply_filters (sheet, pundo);
 
-       if (pundo) {
-               int last = first + (count - 1);
-               GnmRange r;
-               range_init_rows (&r, sheet, first, last);
-               combine_undo (pundo, clipboard_copy_range_undo (sheet, &r));
-               states = colrow_get_states (sheet, FALSE, first, last);
-       }
-
        /* 0. Check displaced/deleted region and ensure arrays aren't divided. */
        /* We need to check at "row" and at "first".  If they coincide, just
           use the end.  */
@@ -5302,6 +5293,13 @@ sheet_insert_rows (Sheet *sheet, int row, int count,
                return TRUE;
 
        /* 1. Delete all rows (and their cells) that will fall off the end */
+       if (pundo) {
+               int last = first + (count - 1);
+               GnmRange r;
+               range_init_rows (&r, sheet, first, last);
+               combine_undo (pundo, clipboard_copy_range_undo (sheet, &r));
+               states = colrow_get_states (sheet, FALSE, first, last);
+       }
        for (i = sheet->rows.max_used; i >= gnm_sheet_get_max_rows (sheet) - count ; --i)
                sheet_row_destroy (sheet, i, TRUE);
 
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index edb9feb..cc970be 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-06  Morten Welinder  <terra gnome org>
+
+       * gnumeric-expr-entry.c (gee_scan_for_range): Plug leak.
+
 2014-09-25  Morten Welinder <terra gnome org>
 
        * Release 1.12.18
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index 347127f..2f9d0bf 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -675,7 +675,6 @@ gee_scan_for_range (GnmExprEntry *gee)
                                                this_colour = colour++;
                                                g_hash_table_insert (hash, rrr, GINT_TO_POINTER 
(this_colour));
                                                insert_cursor = TRUE;
-                                               rtext = NULL;
                                        } else {
                                                this_colour = GPOINTER_TO_INT (val);
                                                insert_cursor = FALSE;


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