From ad3d7761d78d9b5ab0e0152194ebde58cf97a1f6 Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 8 Nov 2021 19:25:05 +0100 Subject: fm-directory-view: fix memory leak --- src/file-manager/fm-directory-view.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 45234c43..0c864417 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -4730,6 +4730,7 @@ reset_open_with_menu (FMDirectoryView *view, GList *selection) GtkUIManager *ui_manager; GtkAction *action; GAppInfo *default_app; + char *uri; /* Clear any previous inserted items in the applications and viewers placeholders */ @@ -4811,12 +4812,15 @@ reset_open_with_menu (FMDirectoryView *view, GList *selection) } /* Show open parent folder action if we are in search mode */ - if (eel_uri_is_search (fm_directory_view_get_uri (view)) && g_list_length (selection) == 1) + uri = fm_directory_view_get_uri (view); + if (eel_uri_is_search (uri) && g_list_length (selection) == 1) add_parent_folder_to_open_menu (view, selection, FM_DIRECTORY_VIEW_MENU_PATH_OPEN, FM_DIRECTORY_VIEW_POPUP_PATH_OPEN); + g_free (uri); + open_with_chooser_visible = other_applications_visible && g_list_length (selection) == 1; -- cgit v1.2.1