[epiphany] downloads-popover: Use g_autoptr
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] downloads-popover: Use g_autoptr
- Date: Fri, 15 Feb 2019 16:34:00 +0000 (UTC)
commit bceb4c6895c44c0623302e7f96aea008c405ec7b
Author: Yi-Soo An <yisooan gmail com>
Date: Fri Feb 15 15:35:52 2019 +0900
downloads-popover: Use g_autoptr
Use g_autoptr instead of manually freeing resources.
lib/widgets/ephy-downloads-popover.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/lib/widgets/ephy-downloads-popover.c b/lib/widgets/ephy-downloads-popover.c
index b70c63f9a..d6a6bd50b 100644
--- a/lib/widgets/ephy-downloads-popover.c
+++ b/lib/widgets/ephy-downloads-popover.c
@@ -100,7 +100,8 @@ static void
download_removed_cb (EphyDownloadsPopover *popover,
EphyDownload *download)
{
- GList *children, *l;
+ g_autoptr(GList) children = NULL;
+ GList *l;
EphyDownloadsManager *manager;
children = gtk_container_get_children (GTK_CONTAINER (popover->downloads_box));
@@ -125,7 +126,6 @@ download_removed_cb (EphyDownloadsPopover *popover,
break;
}
}
- g_list_free (children);
manager = ephy_embed_shell_get_downloads_manager (ephy_embed_shell_get_default ());
gtk_widget_set_sensitive (popover->clear_button, !ephy_downloads_manager_has_active_downloads (manager));
@@ -134,7 +134,8 @@ download_removed_cb (EphyDownloadsPopover *popover,
static void
clear_button_clicked_cb (EphyDownloadsPopover *popover)
{
- GList *children, *l;
+ g_autoptr(GList) children = NULL;
+ GList *l;
EphyDownloadsManager *manager;
gtk_widget_hide (GTK_WIDGET (popover));
@@ -160,7 +161,6 @@ clear_button_clicked_cb (EphyDownloadsPopover *popover)
gtk_widget_destroy (l->data);
}
}
- g_list_free (children);
gtk_widget_set_sensitive (popover->clear_button, FALSE);
g_signal_handlers_unblock_by_func (manager, download_removed_cb, popover);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]