mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
7b457d1b5c
commit
28cc67c9a1
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue