From 418679a91ff711170754ce4d6ed9105e3ae6449b Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 20 Aug 2017 17:35:56 -0400 Subject: Fix crashes on moving/removing applets with glib 2.53.4 or later *On destroying applet disconnect signals for functions that otherwise segfaults with glib 2.53.4 or later. *Fish: it's not always enough for a function to return immediately if applet destroyed anymore *panel-action-button: suppress a warning --- applets/fish/fish.c | 4 ++++ mate-panel/applet.c | 2 ++ mate-panel/panel-action-button.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/applets/fish/fish.c b/applets/fish/fish.c index a9387b88..82d56f22 100644 --- a/applets/fish/fish.c +++ b/applets/fish/fish.c @@ -1757,6 +1757,10 @@ static void fish_applet_dispose (GObject *object) { FishApplet* fish = (FishApplet*) object; + if (fish->settings != NULL) + g_signal_handlers_disconnect_by_data (fish->settings, + fish); + if (fish->timeout) { g_source_remove (fish->timeout); diff --git a/mate-panel/applet.c b/mate-panel/applet.c index 9ed853fd..a76ed9c9 100644 --- a/mate-panel/applet.c +++ b/mate-panel/applet.c @@ -791,6 +791,8 @@ mate_panel_applet_destroy (GtkWidget *widget, { g_return_if_fail (info != NULL); + g_signal_handlers_disconnect_by_data(info->settings,widget); + info->widget = NULL; if (info->settings) { diff --git a/mate-panel/panel-action-button.c b/mate-panel/panel-action-button.c index dc911980..abfe8c22 100644 --- a/mate-panel/panel-action-button.c +++ b/mate-panel/panel-action-button.c @@ -647,6 +647,9 @@ void panel_action_button_set_type (PanelActionButton *button, PanelActionButtonType type) { + if (!type) + return; + g_return_if_fail (type > PANEL_ACTION_NONE && type < PANEL_ACTION_LAST); if (type == button->priv->type) -- cgit v1.2.1