summaryrefslogtreecommitdiff
path: root/applets/clock/clock-map.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-11-28 13:19:58 +0100
committerLuke from DC <[email protected]>2021-12-16 06:52:11 +0000
commit6fbabd51619c92bcd8584e1bb2f12f2b52904ea6 (patch)
tree540229310cf7f6d6b60e82fcd2952a6caec31a4a /applets/clock/clock-map.c
parent94f3ec8c654363cd6a245eb9dca7c54f1b8f5649 (diff)
downloadmate-panel-6fbabd51619c92bcd8584e1bb2f12f2b52904ea6.tar.bz2
mate-panel-6fbabd51619c92bcd8584e1bb2f12f2b52904ea6.tar.xz
Use g_clear_pointer() and g_clear_object()
Diffstat (limited to 'applets/clock/clock-map.c')
-rw-r--r--applets/clock/clock-map.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/applets/clock/clock-map.c b/applets/clock/clock-map.c
index fc096c60..97441c62 100644
--- a/applets/clock/clock-map.c
+++ b/applets/clock/clock-map.c
@@ -150,32 +150,15 @@ clock_map_finalize (GObject *g_obj)
priv->highlight_timeout_id = 0;
}
- if (priv->stock_map_pixbuf) {
- g_object_unref (priv->stock_map_pixbuf);
- priv->stock_map_pixbuf = NULL;
- }
+ g_clear_object (&priv->stock_map_pixbuf);
for (i = 0; i < MARKER_NB; i++) {
- if (priv->location_marker_pixbuf[i]) {
- g_object_unref (priv->location_marker_pixbuf[i]);
- priv->location_marker_pixbuf[i] = NULL;
- }
+ g_clear_object (&priv->location_marker_pixbuf[i]);
}
- if (priv->location_map_pixbuf) {
- g_object_unref (priv->location_map_pixbuf);
- priv->location_map_pixbuf = NULL;
- }
-
- if (priv->shadow_pixbuf) {
- g_object_unref (priv->shadow_pixbuf);
- priv->shadow_pixbuf = NULL;
- }
-
- if (priv->shadow_map_pixbuf) {
- g_object_unref (priv->shadow_map_pixbuf);
- priv->shadow_map_pixbuf = NULL;
- }
+ g_clear_object (&priv->location_map_pixbuf);
+ g_clear_object (&priv->shadow_pixbuf);
+ g_clear_object (&priv->shadow_map_pixbuf);
G_OBJECT_CLASS (clock_map_parent_class)->finalize (g_obj);
}