summaryrefslogtreecommitdiff
path: root/applets/clock/clock-location-tile.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-10-24 21:41:34 +0200
committerLuke from DC <[email protected]>2021-12-19 11:15:02 +0000
commit293948ad80f2f9dddf4af282e2b83b99b2e56014 (patch)
tree5a1dbf47834505e8681ac8c85e8255c1d48b10df /applets/clock/clock-location-tile.c
parent6fbabd51619c92bcd8584e1bb2f12f2b52904ea6 (diff)
downloadmate-panel-293948ad80f2f9dddf4af282e2b83b99b2e56014.tar.bz2
mate-panel-293948ad80f2f9dddf4af282e2b83b99b2e56014.tar.xz
Use GLib's new g_clear_signal_handler() function to simplify code
Diffstat (limited to 'applets/clock/clock-location-tile.c')
-rw-r--r--applets/clock/clock-location-tile.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/applets/clock/clock-location-tile.c b/applets/clock/clock-location-tile.c
index b70f467c..4d0fc217 100644
--- a/applets/clock/clock-location-tile.c
+++ b/applets/clock/clock-location-tile.c
@@ -140,8 +140,16 @@ clock_location_tile_finalize (GObject *g_obj)
priv = clock_location_tile_get_instance_private (this);
if (priv->location) {
- g_signal_handler_disconnect (priv->location, priv->location_weather_updated_id);
- priv->location_weather_updated_id = 0;
+#if GLIB_CHECK_VERSION(2,62,0)
+ g_clear_signal_handler (&priv->location_weather_updated_id,
+ priv->location);
+#else
+ if (priv->location_weather_updated_id != 0) {
+ g_signal_handler_disconnect (priv->location,
+ priv->location_weather_updated_id);
+ priv->location_weather_updated_id = 0;
+ }
+#endif
g_clear_object (&priv->location);
}