diff options
-rw-r--r-- | libdbusmenu-glib/server.c | 5 | ||||
-rw-r--r-- | libdbusmenu-gtk/genericmenuitem.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 9e5ef0c..f47bb5d 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -463,6 +463,11 @@ dbusmenu_server_finalize (GObject *object) { DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(object); + if (priv->dbusobject != NULL) { + g_free (priv->dbusobject); + priv->dbusobject = NULL; + } + if (priv->icon_dirs != NULL) { g_strfreev(priv->icon_dirs); priv->icon_dirs = NULL; diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index 81d67fe..75bdbbd 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -242,7 +242,7 @@ has_mnemonic (const gchar * string, gboolean previous_underscore) } /* Sanitize the label by removing "__" meaning "_" */ -gchar * +static gchar * sanitize_label (const gchar * in_label) { static GRegex * underscore_regex = NULL; @@ -335,10 +335,10 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label) labelw = GTK_LABEL(gtk_accel_label_new(local_label)); gtk_label_set_use_markup(GTK_LABEL(labelw), TRUE); gtk_misc_set_alignment(GTK_MISC(labelw), 0.0, 0.5); + gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(labelw), GTK_WIDGET(menu_item)); if (has_mnemonic(in_label, FALSE)) { gtk_label_set_use_underline(GTK_LABEL(labelw), TRUE); - gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(labelw), GTK_WIDGET(menu_item)); gtk_label_set_markup_with_mnemonic(labelw, local_label); } else { gchar * sanitized = sanitize_label(local_label); @@ -365,7 +365,6 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label) } else { if (has_mnemonic(in_label, FALSE)) { gtk_label_set_use_underline(GTK_LABEL(labelw), TRUE); - gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(labelw), GTK_WIDGET(menu_item)); gtk_label_set_markup_with_mnemonic(labelw, local_label); } else { gchar * sanitized = sanitize_label(local_label); |