From d614f388b0202ae55377b1058d90381b226f4deb Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Tue, 29 May 2018 00:09:27 +0200 Subject: [PATCH] panel-plugin: Try to fix crashes when removing plugins (Bug #14144) While one would expect the menu to be destroyed at this point, it seems not to be the case, so we try to handle it by removing all custom items from the menu. --- libxfce4panel/xfce-panel-plugin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c index 96423298..54b5158b 100644 --- a/libxfce4panel/xfce-panel-plugin.c +++ b/libxfce4panel/xfce-panel-plugin.c @@ -915,6 +915,9 @@ xfce_panel_plugin_finalize (GObject *object) /* destroy the menu */ if (plugin->priv->menu != NULL) { + /* remove custom items before they get destroyed */ + for (li = plugin->priv->menu_items; li != NULL; li = li->next) + gtk_container_remove (GTK_CONTAINER (plugin->priv->menu), GTK_WIDGET (li->data)); /* attached menu is destroyed by GtkWidget */ panel_assert (plugin->priv->menu_items == NULL); } -- 2.14.1