diff options
author | lukefromdc <[email protected]> | 2017-08-22 23:33:39 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2017-08-22 23:33:39 -0400 |
commit | 2dbcb02ab02f99d423f99aea92f3e234475f3bb0 (patch) | |
tree | c0624d4d04c34451fadac4904ac67c6f685ebcca | |
parent | 4fbe8e24933d367316441166ca448cdb03c6a35f (diff) | |
download | mate-panel-2dbcb02ab02f99d423f99aea92f3e234475f3bb0.tar.bz2 mate-panel-2dbcb02ab02f99d423f99aea92f3e234475f3bb0.tar.xz |
clock:disconnect signal handlers on destroy
Don't just check for the clock's existance and return if it has been destroyed, disconnect them entirely when the clock is destroyed
-rw-r--r-- | applets/clock/clock.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c index f52ce88b..025d5bb3 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -501,8 +501,6 @@ get_updated_timeformat (ClockData *cd) static void update_timeformat (ClockData *cd) { - if (cd->settings == NULL) - return; if (cd->timeformat) g_free (cd->timeformat); cd->timeformat = get_updated_timeformat (cd); @@ -703,8 +701,6 @@ update_tooltip (ClockData * cd) static void refresh_clock (ClockData *cd) { - if (cd->settings == NULL) - return; unfix_size (cd); update_clock (cd); } @@ -712,9 +708,6 @@ refresh_clock (ClockData *cd) static void refresh_clock_timeout(ClockData *cd) { - if (cd->settings == NULL) - return; - unfix_size (cd); update_timeformat (cd); @@ -757,6 +750,9 @@ static void destroy_clock (GtkWidget * widget, ClockData *cd) { if (cd->settings) + g_signal_handlers_disconnect_by_data( cd->settings, cd); + + if (cd->settings) g_object_unref (cd->settings); cd->settings = NULL; @@ -2002,9 +1998,6 @@ static void update_weather_bool_value_and_toggle_from_gsettings (ClockData *cd, gchar *key, gboolean *value_loc, const char *widget_name) { - if (cd->settings == NULL) - return; - GtkWidget *widget; gboolean value; @@ -2084,9 +2077,6 @@ location_set_current_cb (ClockLocation *loc, static void locations_changed (ClockData *cd) { - if (cd->settings == NULL) - return; - GList *l; ClockLocation *loc; glong id; @@ -2290,9 +2280,6 @@ temperature_unit_changed (GSettings *settings, gchar *key, ClockData *cd) { - if (cd->settings == NULL) - return; - cd->temperature_unit = g_settings_get_enum (settings, key); if (cd->temperature_unit > 0) { @@ -2311,9 +2298,6 @@ speed_unit_changed (GSettings *settings, gchar *key, ClockData *cd) { - if (cd->settings == NULL) - return; - cd->speed_unit = g_settings_get_enum (settings, key); if (cd->speed_unit > 0) { @@ -2332,9 +2316,6 @@ custom_format_changed (GSettings *settings, gchar *key, ClockData *clock) { - if (clock->settings == NULL) - return; - gchar *value; value = g_settings_get_string (settings, key); |