[epiphany] bookmark-row: Use g_autoptr
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] bookmark-row: Use g_autoptr
- Date: Mon, 3 Dec 2018 17:41:27 +0000 (UTC)
commit 04d6bf215d451b940ed73a585b9d4c50d0bc2bc1
Author: Yi-Soo An <yisooan gmail com>
Date: Mon Dec 3 12:54:59 2018 +0900
bookmark-row: Use g_autoptr
Use g_autoptr instead of manually freeing resources.
src/bookmarks/ephy-bookmark-row.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmark-row.c b/src/bookmarks/ephy-bookmark-row.c
index 7ac417ad6..3f5414fd2 100644
--- a/src/bookmarks/ephy-bookmark-row.c
+++ b/src/bookmarks/ephy-bookmark-row.c
@@ -82,10 +82,10 @@ ephy_bookmark_row_favicon_loaded_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
- EphyBookmarkRow *self = user_data;
+ g_autoptr(EphyBookmarkRow) self = user_data;
WebKitFaviconDatabase *database = WEBKIT_FAVICON_DATABASE (source);
cairo_surface_t *icon_surface;
- GdkPixbuf *favicon = NULL;
+ g_autoptr(GdkPixbuf) favicon = NULL;
g_assert (EPHY_IS_BOOKMARK_ROW (self));
@@ -98,10 +98,7 @@ ephy_bookmark_row_favicon_loaded_cb (GObject *source,
if (favicon) {
if (self->favicon_image != NULL)
gtk_image_set_from_pixbuf (GTK_IMAGE (self->favicon_image), favicon);
- g_object_unref (favicon);
}
-
- g_object_unref (self);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]