[nautilus/wip/antoniof/meets-valgrind: 14/22] toolbar: Don't leak menu models
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/meets-valgrind: 14/22] toolbar: Don't leak menu models
- Date: Tue, 22 Dec 2020 16:23:00 +0000 (UTC)
commit 1290c1aac6295edad85813f71c89630f7a0f8355
Author: António Fernandes <antoniof gnome org>
Date: Sat Dec 19 18:02:07 2020 +0000
toolbar: Don't leak menu models
g_object_get() returns a ref to the property object. We must unref it.
src/nautilus-toolbar.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index eb8605406..a64518d8e 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -1297,8 +1297,11 @@ slot_on_extensions_background_menu_changed (NautilusToolbar *self,
GParamSpec *param,
NautilusWindowSlot *slot)
{
+ g_autoptr (GMenuModel) menu = NULL;
+
+ menu = nautilus_window_slot_get_extensions_background_menu (slot);
nautilus_path_bar_set_extensions_background_menu (NAUTILUS_PATH_BAR (self->path_bar),
- nautilus_window_slot_get_extensions_background_menu
(slot));
+ menu);
}
static void
@@ -1306,8 +1309,11 @@ slot_on_templates_menu_changed (NautilusToolbar *self,
GParamSpec *param,
NautilusWindowSlot *slot)
{
+ g_autoptr (GMenuModel) menu = NULL;
+
+ menu = nautilus_window_slot_get_templates_menu (slot);
nautilus_path_bar_set_templates_menu (NAUTILUS_PATH_BAR (self->path_bar),
- nautilus_window_slot_get_templates_menu (slot));
+ menu);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]