diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2012-10-01 22:22:12 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-10-01 14:06:46 -0700 |
commit | 0559a6a7831ecdae9274fa5e67f941660a6bbab1 (patch) | |
tree | 5f4143eb947481f883f48c0826d4a60329fcb391 /info.c | |
parent | 3244a828f3df9b0403db7de742de399edcb395bb (diff) | |
download | subsurface-0559a6a7831ecdae9274fa5e67f941660a6bbab1.tar.gz |
Fixed some small memory leaks
Looks like a GtkEntryCompletion object created with
gtk_entry_completion_new() should be unreferenced after usage
(e.g. post gtk_entry_set_completion())
In info.c:get_combo_box_entry_text(), moved the free(..) line outside,
so that we can free regardless.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r-- | info.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -264,6 +264,7 @@ static GtkComboBoxEntry *text_entry(GtkWidget *box, const char *label, GtkListSt gtk_entry_completion_set_inline_selection(completion, TRUE); gtk_entry_completion_set_popup_single_match(completion, FALSE); gtk_entry_set_completion(entry, completion); + g_object_unref(completion); return GTK_COMBO_BOX_ENTRY(combo_box); } @@ -427,9 +428,9 @@ static void save_dive_info_changes(struct dive *dive, struct dive *master, struc new_text = get_combo_box_entry_text(info->rating, &rating_string, star_strings[master->rating]); if (new_text) { dive->rating = get_rating(rating_string); - free(rating_string); - changed =1; + changed = 1; } + free(rating_string); if (info->notes) { old_text = dive->notes; |