From 4fbe8e24933d367316441166ca448cdb03c6a35f 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 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'applets') 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); -- cgit v1.2.1