gcalctool r2170 - trunk/gcalctool
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gcalctool r2170 - trunk/gcalctool
- Date: Mon, 18 Aug 2008 22:48:10 +0000 (UTC)
Author: rancell
Date: Mon Aug 18 22:48:10 2008
New Revision: 2170
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2170&view=rev
Log:
Fix GtkListStore memory leaks (Bug #547942)
Modified:
trunk/gcalctool/gtk.c
Modified: trunk/gcalctool/gtk.c
==============================================================================
--- trunk/gcalctool/gtk.c (original)
+++ trunk/gcalctool/gtk.c Mon Aug 18 22:48:10 2008
@@ -1121,7 +1121,6 @@
GtkTreeModel *model = (GtkTreeModel *) data;
GtkTreePath *path = gtk_tree_path_new_from_string(path_string);
GtkTreeIter iter;
- gchar *old_text;
gint *column;
column = g_object_get_data(G_OBJECT(cell), "column");
@@ -1130,17 +1129,13 @@
switch (GPOINTER_TO_INT(column)) {
case COLUMN_VALUE:
- gtk_tree_model_get(model, &iter, column, &old_text, -1);
- g_free(old_text);
gtk_list_store_set(GTK_LIST_STORE(model), &iter, column,
- g_strdup(new_text), -1);
+ g_strdup(new_text), -1);
break;
case COLUMN_DESCRIPTION:
- gtk_tree_model_get(model, &iter, column, &old_text, -1);
- g_free(old_text);
gtk_list_store_set(GTK_LIST_STORE(model), &iter, column,
- g_strdup(new_text), -1);
+ g_strdup(new_text), -1);
break;
}
@@ -1505,8 +1500,8 @@
gtk_list_store_set(model, &iter,
COLUMN_NUMBER, i,
COLUMN_EDITABLE, TRUE,
- COLUMN_VALUE, g_strdup(constant),
- COLUMN_DESCRIPTION, g_strdup(v->con_names[i]),
+ COLUMN_VALUE, constant,
+ COLUMN_DESCRIPTION, v->con_names[i],
-1);
}
@@ -1530,8 +1525,8 @@
gtk_list_store_set(model, &iter,
COLUMN_NUMBER, i,
COLUMN_EDITABLE, TRUE,
- COLUMN_VALUE, g_strdup(v->fun_vals[i]),
- COLUMN_DESCRIPTION, g_strdup(v->fun_names[i]),
+ COLUMN_VALUE, v->fun_vals[i],
+ COLUMN_DESCRIPTION, v->fun_names[i],
-1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]