summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-12-17 00:26:34 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-16 15:56:58 -1000
commit28cc67c9a1b6c24efc2bcac12587de45484e05a6 (patch)
treedcdd689acc8f9a934769b35f3ef198be2968a57a
parent7b457d1b5c44db5db1a2bace178fd9c3e447a65c (diff)
downloadsubsurface-28cc67c9a1b6c24efc2bcac12587de45484e05a6.tar.gz
Fixed a couple of memory leaks related to the download dialog
In render_dc_vendor() and render_dc_product(), there is no need to allocate memory for the texts that are about to be added in the combo box trees. Most GTK widgets seem to make copies of the passed text to them, using g_strdup() and automatically release said memory when a widget is destroyed. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--gtk-gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 5a35b3940..834d1999f 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -1663,7 +1663,7 @@ void render_dc_vendor(GtkCellLayout *cell,
const char *vendor;
gtk_tree_model_get(model, iter, 0, &vendor, -1);
- g_object_set(renderer, "text", strdup(vendor), NULL);
+ g_object_set(renderer, "text", vendor, NULL);
}
void render_dc_product(GtkCellLayout *cell,
@@ -1677,7 +1677,7 @@ void render_dc_product(GtkCellLayout *cell,
gtk_tree_model_get(model, iter, 0, &descriptor, -1);
product = dc_descriptor_get_product(descriptor);
- g_object_set(renderer, "text", strdup(product), NULL);
+ g_object_set(renderer, "text", product, NULL);
}
static void dive_computer_selector_changed(GtkWidget *combo, gpointer data)