Fixed a memory leak related to the satelite icon

divelist.c:get_gps_icon_for_dive()
In all callers of the function use gdk_pixbuf_unref() to
release the returned GdkPixbuf (but also check for NULL).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2013-02-09 21:29:59 +02:00 committed by Dirk Hohndel
parent 363c38f557
commit ea21126f62

View file

@ -921,6 +921,8 @@ static void fill_one_dive(struct dive *dive,
DIVE_SUIT, suit,
-1);
if (icon)
gdk_pixbuf_unref(icon);
free(location);
free(cylinder);
free(suit);
@ -1325,6 +1327,8 @@ static void fill_dive_list(void)
DIVE_TEMPERATURE, dive->watertemp.mkelvin,
DIVE_SAC, 0,
-1);
if (icon)
gdk_pixbuf_unref(icon);
gtk_tree_store_append(liststore, &iter, NULL);
gtk_tree_store_set(liststore, &iter,
DIVE_INDEX, i,