[epiphany] Fix g_action_print_detailed_name leaks
- From: Iulian Radu <iulianradu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Fix g_action_print_detailed_name leaks
- Date: Thu, 28 Jul 2016 12:32:39 +0000 (UTC)
commit f3ef6a5f8f7375bd41920fba7346171464b14fa4
Author: Iulian Radu <iulian radu67 gmail com>
Date: Thu Jul 28 12:53:43 2016 +0300
Fix g_action_print_detailed_name leaks
src/bookmarks/ephy-bookmarks-menu.c | 7 +++++--
src/ephy-window.c | 10 ++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c
index 4a89d58..e1464fe 100644
--- a/src/bookmarks/ephy-bookmarks-menu.c
+++ b/src/bookmarks/ephy-bookmarks-menu.c
@@ -52,18 +52,21 @@ append_bookmarks (GMenu *menu,
{
EphyNode *child;
const gchar *action_name;
+ GVariant *location;
long i;
for (i = 0; i < bookmarks->len; i++) {
child = g_ptr_array_index (bookmarks, i);
- action_name = g_action_print_detailed_name ("win.open-bookmark",
- g_variant_new_string (ephy_node_get_property_string (child,
EPHY_NODE_BMK_PROP_LOCATION)));
+ location = g_variant_new_string (ephy_node_get_property_string (child, EPHY_NODE_BMK_PROP_LOCATION));
+ action_name = g_action_print_detailed_name ("win.open-bookmark", location);
+ g_variant_unref (location);
g_menu_append (menu,
ephy_node_get_property_string (child, EPHY_NODE_BMK_PROP_TITLE),
action_name);
+
}
}
diff --git a/src/ephy-window.c b/src/ephy-window.c
index de3d734..fc8e4e7 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1481,10 +1481,13 @@ populate_context_menu (WebKitWebView *web_view,
char *ellipsized = ellipsize_string (selected_text, 32);
if (ellipsized) {
gchar *label;
+ GVariant *value;
label = g_strdup_printf (_("Search the Web for '%s'"), ellipsized);
+ value = g_variant_new_string (label);
search_selection_action_name = g_action_print_detailed_name ("search-selection",
- g_variant_new_string (label)),
+ value);
+ g_variant_unref (value);
can_search_selection = TRUE;
g_free (label);
@@ -2270,16 +2273,18 @@ setup_tab_accels (EphyWindow *window)
for (i = 0; i < TAB_ACCELS_N; i++) {
GSimpleAction *simple_action;
char *action_name;
+ char *action_name_with_tab;
char *accel;
action_name = g_strdup_printf ("accel-%d", i);
+ action_name_with_tab = g_strconcat ("tab.", action_name, NULL);
accel = g_strdup_printf ("<alt>%d", (i + 1) % TAB_ACCELS_N);
simple_action = g_simple_action_new (action_name, NULL);
g_action_map_add_action (G_ACTION_MAP (action_group), G_ACTION (simple_action));
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
- g_strconcat ("tab.", action_name, NULL),
+ action_name_with_tab,
(const gchar*[]) {accel, NULL});
g_signal_connect (G_ACTION (simple_action), "activate",
@@ -2288,6 +2293,7 @@ setup_tab_accels (EphyWindow *window)
g_object_unref (simple_action);
g_free (accel);
g_free (action_name);
+ g_free (action_name_with_tab);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]