[gnac] Fixed memory leaks
- From: BenoÃt Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac] Fixed memory leaks
- Date: Wed, 1 Feb 2012 00:58:01 +0000 (UTC)
commit a9bb9a35903c2cee77d0f04bd7d7e1964c9b4654
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date: Wed Feb 1 00:57:24 2012 +0000
Fixed memory leaks
libgnac/libgnac-metadata.c | 1 +
src/gnac-main.c | 3 +++
src/gnac-properties.c | 1 +
src/gnac-ui-utils.c | 2 +-
src/gnac-ui.c | 1 +
5 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libgnac/libgnac-metadata.c b/libgnac/libgnac-metadata.c
index 33caa98..b37f176 100644
--- a/libgnac/libgnac-metadata.c
+++ b/libgnac/libgnac-metadata.c
@@ -367,6 +367,7 @@ libgnac_metadata_get_file_info(GFile *uri, LibgnacMetadata *md)
if (thumbnail_path) {
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(thumbnail_path, NULL);
libgnac_metadata_add_object_value(md, GST_TAG_IMAGE, G_OBJECT(pixbuf));
+ g_object_unref(pixbuf);
}
g_object_unref(info);
diff --git a/src/gnac-main.c b/src/gnac-main.c
index 479c240..afb8dd4 100644
--- a/src/gnac-main.c
+++ b/src/gnac-main.c
@@ -159,6 +159,7 @@ gnac_add_directory(GFile *file)
GFile *child = g_file_get_child(file, g_file_info_get_name(info));
gnac_add(child);
g_object_unref(child);
+ g_object_unref(info);
}
if (error) {
@@ -171,6 +172,8 @@ gnac_add_directory(GFile *file)
libgnac_debug("%s", error->message);
g_clear_error(&error);
}
+
+ g_object_unref(enumerator);
}
diff --git a/src/gnac-properties.c b/src/gnac-properties.c
index 81ea6a1..c355661 100644
--- a/src/gnac-properties.c
+++ b/src/gnac-properties.c
@@ -311,6 +311,7 @@ gnac_properties_set_image(GtkWidget *widget,
pixbuf = gnac_ui_utils_scale_pixbuf(pixbuf, 96, 96);
pixbuf = gnac_ui_utils_add_border_to_pixbuf(pixbuf);
gtk_image_set_from_pixbuf(GTK_IMAGE(widget), pixbuf);
+ g_object_unref(pixbuf);
}
diff --git a/src/gnac-ui-utils.c b/src/gnac-ui-utils.c
index e52c67a..0a4e42c 100644
--- a/src/gnac-ui-utils.c
+++ b/src/gnac-ui-utils.c
@@ -93,7 +93,7 @@ gnac_ui_utils_add_border_to_pixbuf(GdkPixbuf *pixbuf)
gdk_pixbuf_fill(bordered, 0xff);
gdk_pixbuf_copy_area(pixbuf, 0, 0, width, height, bordered,
GNAC_UTILS_ICON_BORDER_WIDTH, GNAC_UTILS_ICON_BORDER_WIDTH);
-
+ g_object_unref(pixbuf);
return bordered;
}
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index 7656bae..05ce579 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -1194,6 +1194,7 @@ gnac_ui_query_tooltip_cb(GtkStatusIcon *status_icon,
pixbuf = gnac_ui_utils_scale_pixbuf(pixbuf, 80, 80);
pixbuf = gnac_ui_utils_add_border_to_pixbuf(pixbuf);
gtk_tooltip_set_icon(tooltip, pixbuf);
+ g_object_unref(pixbuf);
}
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]