Skip to content
Snippets Groups Projects
Commit 09153a98 authored by Alexander Schwinn's avatar Alexander Schwinn
Browse files

Critical error when opening Edit menu (Issue #542)

Regression introduced by 1c7d74c7 (Issue #517)

Fixes #542
parent 3e517819
No related branches found
No related tags found
No related merge requests found
...@@ -87,8 +87,8 @@ thunar_gtk_menu_thunarx_menu_item_new (GObject *thunarx_menu_item, ...@@ -87,8 +87,8 @@ thunar_gtk_menu_thunarx_menu_item_new (GObject *thunarx_menu_item,
GList *children; GList *children;
GList *lp; GList *lp;
GtkWidget *submenu; GtkWidget *submenu;
GtkWidget *image; GtkWidget *image = NULL;
GIcon *icon; GIcon *icon = NULL;
g_return_val_if_fail (THUNARX_IS_MENU_ITEM (thunarx_menu_item), NULL); g_return_val_if_fail (THUNARX_IS_MENU_ITEM (thunarx_menu_item), NULL);
...@@ -102,8 +102,10 @@ thunar_gtk_menu_thunarx_menu_item_new (GObject *thunarx_menu_item, ...@@ -102,8 +102,10 @@ thunar_gtk_menu_thunarx_menu_item_new (GObject *thunarx_menu_item,
NULL); NULL);
accel_path = g_strconcat ("<Actions>/ThunarActions/", name, NULL); accel_path = g_strconcat ("<Actions>/ThunarActions/", name, NULL);
icon = g_icon_new_for_string (icon_name, NULL); if (icon_name != NULL)
image = gtk_image_new_from_gicon (icon,GTK_ICON_SIZE_MENU); icon = g_icon_new_for_string (icon_name, NULL);
if (icon != NULL)
image = gtk_image_new_from_gicon (icon,GTK_ICON_SIZE_MENU);
gtk_menu_item = xfce_gtk_image_menu_item_new (label_text, tooltip_text, accel_path, gtk_menu_item = xfce_gtk_image_menu_item_new (label_text, tooltip_text, accel_path,
G_CALLBACK (thunarx_menu_item_activate), G_CALLBACK (thunarx_menu_item_activate),
G_OBJECT (thunarx_menu_item), image, menu_to_append_item); G_OBJECT (thunarx_menu_item), image, menu_to_append_item);
...@@ -118,12 +120,15 @@ thunar_gtk_menu_thunarx_menu_item_new (GObject *thunarx_menu_item, ...@@ -118,12 +120,15 @@ thunar_gtk_menu_thunarx_menu_item_new (GObject *thunarx_menu_item,
gtk_menu_item_set_submenu (GTK_MENU_ITEM (gtk_menu_item), submenu); gtk_menu_item_set_submenu (GTK_MENU_ITEM (gtk_menu_item), submenu);
thunarx_menu_item_list_free (children); thunarx_menu_item_list_free (children);
} }
g_free (name); g_free (name);
g_free (accel_path); g_free (accel_path);
g_free (label_text); g_free (label_text);
g_free (tooltip_text); g_free (tooltip_text);
g_free (icon_name); if (icon_name != NULL)
g_object_unref (icon); g_free (icon_name);
if (icon != NULL)
g_object_unref (icon);
return gtk_menu_item; return gtk_menu_item;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment