diff options
author | António Fernandes <antoniof@gnome.org> | 2020-12-19 18:02:07 +0000 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2021-01-05 08:50:24 +0000 |
commit | 9b62be1e1e814a0ea48a50f0ec3902927672e428 (patch) | |
tree | ef87c57633e42edc32fcd100c90ec9e844a48841 | |
parent | 342207ef66e3763dee08b6f208959bcfce9929b2 (diff) | |
download | nautilus-9b62be1e1e814a0ea48a50f0ec3902927672e428.tar.gz |
toolbar: Don't leak menu models
g_object_get() returns a ref to the property object. We must unref it.
-rw-r--r-- | src/nautilus-toolbar.c | 10 |
1 files 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 |