summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-08-20 17:35:56 -0400
committerlukefromdc <[email protected]>2017-08-22 02:18:09 -0400
commit4fbe8e24933d367316441166ca448cdb03c6a35f (patch)
tree579da4f92038b5754754b1c275ccb665ad3c670d
parent57d3c8f702887516504c54c398d40e7343e93138 (diff)
downloadmate-panel-4fbe8e24933d367316441166ca448cdb03c6a35f.tar.bz2
mate-panel-4fbe8e24933d367316441166ca448cdb03c6a35f.tar.xz
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
-rw-r--r--applets/fish/fish.c10
-rw-r--r--mate-panel/applet.c2
-rw-r--r--mate-panel/panel-action-button.c3
3 files changed, 9 insertions, 6 deletions
diff --git a/applets/fish/fish.c b/applets/fish/fish.c
index 95b22833..56def60c 100644
--- a/applets/fish/fish.c
+++ b/applets/fish/fish.c
@@ -995,9 +995,6 @@ static void display_fortune_dialog(FishApplet* fish)
static void name_changed_notify(GSettings* settings, gchar* key, FishApplet* fish)
{
- if (fish->source_id == 0)
- return;
-
char *value;
value = g_settings_get_string (settings, key);
@@ -1023,9 +1020,6 @@ static void name_changed_notify(GSettings* settings, gchar* key, FishApplet* fis
static void image_changed_notify(GSettings* settings, gchar* key, FishApplet* fish)
{
- if (fish->source_id == 0)
- return;
-
char *value;
value = g_settings_get_string (settings, key);
@@ -1778,6 +1772,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 85fd3ac1..86399908 100644
--- a/mate-panel/applet.c
+++ b/mate-panel/applet.c
@@ -796,6 +796,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)