Commit e6a40ca0 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow

fix leak (invalidate_refs) : fix leak (cb_name_invalidate_sheet) : fix

2002-04-11  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* src/dependent.c (dependent_set_expr) : fix leak
	(invalidate_refs) : fix leak
	(cb_name_invalidate_sheet) : fix leak
	* src/expr-name.c (expr_name_create) : fix leak
parent cc39b1f8
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/dependent.c (dependent_set_expr) : fix leak
(invalidate_refs) : fix leak
(cb_name_invalidate_sheet) : fix leak
* src/expr-name.c (expr_name_create) : fix leak
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-graphic.c (cb_dialog_graphic_config_apply_clicked) :
......
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/dependent.c (dependent_set_expr) : fix leak
(invalidate_refs) : fix leak
(cb_name_invalidate_sheet) : fix leak
* src/expr-name.c (expr_name_create) : fix leak
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-graphic.c (cb_dialog_graphic_config_apply_clicked) :
......
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/dependent.c (dependent_set_expr) : fix leak
(invalidate_refs) : fix leak
(cb_name_invalidate_sheet) : fix leak
* src/expr-name.c (expr_name_create) : fix leak
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-graphic.c (cb_dialog_graphic_config_apply_clicked) :
......
......@@ -145,8 +145,6 @@ dependent_set_expr (Dependent *dep, GnmExpr const *new_expr)
}
#endif
if (new_expr != NULL)
gnm_expr_ref (new_expr);
if (dependent_is_linked (dep))
dependent_unlink (dep, NULL);
......@@ -160,6 +158,8 @@ dependent_set_expr (Dependent *dep, GnmExpr const *new_expr)
DependentClass *klass = g_ptr_array_index (dep_classes, t);
g_return_if_fail (klass);
if (new_expr != NULL)
gnm_expr_ref (new_expr);
if (klass->set_expr != NULL)
(*klass->set_expr) (dep, new_expr);
......@@ -1540,8 +1540,10 @@ invalidate_refs (Dependent *dep, GnmExprRewriteInfo const *rwinfo)
* 2j we had a duplicate reference and we have already removed it.
* 3) We depended on things via a name which will be invalidated elsewhere
*/
if (newtree != NULL)
if (newtree != NULL) {
dependent_set_expr (dep, newtree);
gnm_expr_unref (newtree);
}
}
/*
......@@ -1610,6 +1612,7 @@ cb_name_invalidate_sheet (gpointer key, gpointer value, gpointer rwinfo)
GnmExpr const *new_expr = gnm_expr_rewrite (nexpr->t.expr_tree, rwinfo);
g_return_if_fail (new_expr != NULL);
expr_name_set_expr (nexpr, new_expr);
gnm_expr_unref (new_expr);
}
/*
......
......@@ -308,6 +308,7 @@ expr_name_create (ParsePos const *pp, char const *name,
* creation error back to the calling routine
*/
res = expr_name_add (pp, name, expr, &err);
gnm_expr_unref (expr);
if (err != NULL)
error->message = g_strdup (err);
return res;
......
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