From e86397d000d3d307cb425404c74f963c0073b99b Mon Sep 17 00:00:00 2001 From: monsta Date: Wed, 20 Dec 2017 17:31:48 +0300 Subject: pluma-window: have GtkRecentData on stack instead of allocating it adapted from: https://git.gnome.org/browse/gedit/commit/?id=cd9ed7b05eb0397ac3345d7e5177d2a112e7874b --- pluma/pluma-window.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c index 8e107f92..e56fd84f 100644 --- a/pluma/pluma-window.c +++ b/pluma/pluma-window.c @@ -1138,7 +1138,7 @@ _pluma_recent_add (PlumaWindow *window, const gchar *mime) { GtkRecentManager *recent_manager; - GtkRecentData *recent_data; + GtkRecentData recent_data; static gchar *groups[2] = { "pluma", @@ -1147,23 +1147,19 @@ _pluma_recent_add (PlumaWindow *window, recent_manager = gtk_recent_manager_get_default (); - recent_data = g_slice_new (GtkRecentData); - - recent_data->display_name = NULL; - recent_data->description = NULL; - recent_data->mime_type = (gchar *) mime; - recent_data->app_name = (gchar *) g_get_application_name (); - recent_data->app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL); - recent_data->groups = groups; - recent_data->is_private = FALSE; + recent_data.display_name = NULL; + recent_data.description = NULL; + recent_data.mime_type = (gchar *) mime; + recent_data.app_name = (gchar *) g_get_application_name (); + recent_data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL); + recent_data.groups = groups; + recent_data.is_private = FALSE; gtk_recent_manager_add_full (recent_manager, uri, - recent_data); - - g_free (recent_data->app_exec); + &recent_data); - g_slice_free (GtkRecentData, recent_data); + g_free (recent_data.app_exec); } void -- cgit v1.2.1