Commit afc6b355 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

This is somewhere between tragic and ridiculous. INTERSECT and friends

still leak like crazy.


1999-08-01  Morten Welinder  <terra@diku.dk>

	* src/format.c (format_number): YAL -- yet another leak.

	* src/fn-string.c (gnumeric_text): Plug leak.

	* src/expr.c (do_expr_tree_unref): Plug array value leak.

	* src/cell.c (cell_set_array_formula): Unref the wrappers so we
 	don't leak a reference.

	* src/fn-math.c (gnumeric_countif): Initialise total_num member.
parent 649b118d
1999-08-01 Morten Welinder <terra@diku.dk>
* src/format.c (format_number): YAL -- yet another leak.
* src/fn-string.c (gnumeric_text): Plug leak.
* src/expr.c (do_expr_tree_unref): Plug array value leak.
* src/cell.c (cell_set_array_formula): Unref the wrappers so we
don't leak a reference.
* src/fn-math.c (gnumeric_countif): Initialise total_num member.
1999-07-31 Morten Welinder <terra@diku.dk>
* src/fn-database.c (free_criterias): Plug massive leak.
......
1999-08-01 Morten Welinder <terra@diku.dk>
* src/format.c (format_number): YAL -- yet another leak.
* src/fn-string.c (gnumeric_text): Plug leak.
* src/expr.c (do_expr_tree_unref): Plug array value leak.
* src/cell.c (cell_set_array_formula): Unref the wrappers so we
don't leak a reference.
* src/fn-math.c (gnumeric_countif): Initialise total_num member.
1999-07-31 Morten Welinder <terra@diku.dk>
* src/fn-database.c (free_criterias): Plug massive leak.
......
......@@ -133,6 +133,8 @@ callback_function_criteria (Sheet *sheet, int col, int row,
n = g_new (int, 1);
*((int *) n) = mm->total_num;
mm->list = g_slist_append (mm->list, n);
/* FIXME: is this right? -- MW. */
value_release(v);
} else
mm->list = g_slist_append (mm->list, v);
mm->num++;
......@@ -476,6 +478,7 @@ gnumeric_countif (FunctionEvalInfo *ei, Value **argv)
GSList *list;
items.num = 0;
items.total_num = 0;
items.list = NULL;
items.actual_range = FALSE;
......
......@@ -677,10 +677,11 @@ gnumeric_text (FunctionEvalInfo *ei, Value **args)
if (ok)
{
char const *str = format_value (format,
(tmp != NULL) ? tmp : arg,
NULL);
char *str = format_value (format,
(tmp != NULL) ? tmp : arg,
NULL);
res = value_new_string (str);
g_free (str);
} else
res = value_new_error (&ei->pos, _("Type mismatch"));
......
......@@ -805,7 +805,7 @@ cell_set_array_formula (Sheet *sheet,
int x, y;
Cell * const corner = sheet_cell_fetch (sheet, col_a, row_a);
Cell * cell = NULL;
ExprTree *wrapper = NULL;
ExprTree *wrapper;
g_return_if_fail (num_cols > 0);
g_return_if_fail (num_rows > 0);
......@@ -817,6 +817,7 @@ cell_set_array_formula (Sheet *sheet,
wrapper->u.array.corner.func.expr = formula;
expr_tree_ref (formula);
cell_set_formula_tree_simple (corner, wrapper);
expr_tree_unref (wrapper);
/* The corner must be 1st on the recalc list, queue it later */
cell_unqueue_from_recalc (corner);
......@@ -830,6 +831,7 @@ cell_set_array_formula (Sheet *sheet,
num_rows, num_cols);
wrapper->u.array.corner.cell = corner;
cell_set_formula_tree_simple (cell, wrapper);
expr_tree_unref (wrapper);
}
/* Put the corner at the head of the recalc list */
......
......@@ -378,8 +378,11 @@ do_expr_tree_unref (ExprTree *tree)
do_expr_tree_unref (tree->u.value);
break;
case OPER_ARRAY:
if (tree->u.array.x == 0 && tree->u.array.y == 0)
if (tree->u.array.x == 0 && tree->u.array.y == 0) {
if (tree->u.array.corner.func.value)
value_release (tree->u.array.corner.func.value);
do_expr_tree_unref (tree->u.array.corner.func.expr);
}
break;
default:
g_warning ("do_expr_tree_unref error\n");
......
......@@ -133,6 +133,8 @@ callback_function_criteria (Sheet *sheet, int col, int row,
n = g_new (int, 1);
*((int *) n) = mm->total_num;
mm->list = g_slist_append (mm->list, n);
/* FIXME: is this right? -- MW. */
value_release(v);
} else
mm->list = g_slist_append (mm->list, v);
mm->num++;
......@@ -476,6 +478,7 @@ gnumeric_countif (FunctionEvalInfo *ei, Value **argv)
GSList *list;
items.num = 0;
items.total_num = 0;
items.list = NULL;
items.actual_range = FALSE;
......
......@@ -677,10 +677,11 @@ gnumeric_text (FunctionEvalInfo *ei, Value **args)
if (ok)
{
char const *str = format_value (format,
(tmp != NULL) ? tmp : arg,
NULL);
char *str = format_value (format,
(tmp != NULL) ? tmp : arg,
NULL);
res = value_new_string (str);
g_free (str);
} else
res = value_new_error (&ei->pos, _("Type mismatch"));
......
......@@ -818,8 +818,12 @@ format_number (gdouble number, const StyleFormatEntry *style_format_entry)
break;
case ')':
if (can_render_number && !info.rendered)
g_string_append (result, do_render_number (number, &info));
if (can_render_number && !info.rendered) {
char *ntxt;
ntxt = do_render_number (number, &info);
g_string_append (result, ntxt);
g_free (ntxt);
}
g_string_append_c (result, *format);
break;
......
......@@ -133,6 +133,8 @@ callback_function_criteria (Sheet *sheet, int col, int row,
n = g_new (int, 1);
*((int *) n) = mm->total_num;
mm->list = g_slist_append (mm->list, n);
/* FIXME: is this right? -- MW. */
value_release(v);
} else
mm->list = g_slist_append (mm->list, v);
mm->num++;
......@@ -476,6 +478,7 @@ gnumeric_countif (FunctionEvalInfo *ei, Value **argv)
GSList *list;
items.num = 0;
items.total_num = 0;
items.list = NULL;
items.actual_range = FALSE;
......
......@@ -677,10 +677,11 @@ gnumeric_text (FunctionEvalInfo *ei, Value **args)
if (ok)
{
char const *str = format_value (format,
(tmp != NULL) ? tmp : arg,
NULL);
char *str = format_value (format,
(tmp != NULL) ? tmp : arg,
NULL);
res = value_new_string (str);
g_free (str);
} else
res = value_new_error (&ei->pos, _("Type mismatch"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment