summaryrefslogtreecommitdiff
path: root/mate-panel/panel-widget.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 /mate-panel/panel-widget.c
parent94f3ec8c654363cd6a245eb9dca7c54f1b8f5649 (diff)
downloadmate-panel-6fbabd51619c92bcd8584e1bb2f12f2b52904ea6.tar.bz2
mate-panel-6fbabd51619c92bcd8584e1bb2f12f2b52904ea6.tar.xz
Use g_clear_pointer() and g_clear_object()
Diffstat (limited to 'mate-panel/panel-widget.c')
-rw-r--r--mate-panel/panel-widget.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c
index 574d419b..6b4251db 100644
--- a/mate-panel/panel-widget.c
+++ b/mate-panel/panel-widget.c
@@ -1271,12 +1271,8 @@ panel_widget_get_preferred_size(GtkWidget *widget,
}
panel->nb_applets_size_hints = 0;
- if (panel->applets_hints != NULL)
- g_free (panel->applets_hints);
- panel->applets_hints = NULL;
- if (panel->applets_using_hint != NULL)
- g_free (panel->applets_using_hint);
- panel->applets_using_hint = NULL;
+ g_clear_pointer (&panel->applets_hints, g_free);
+ g_clear_pointer (&panel->applets_using_hint, g_free);
if (panel->packed) {
/* put the list in the correct order: this is important
@@ -1595,12 +1591,8 @@ panel_widget_finalize (GObject *obj)
panel = PANEL_WIDGET (obj);
- if (panel->applets_hints != NULL)
- g_free (panel->applets_hints);
- panel->applets_hints = NULL;
- if (panel->applets_using_hint != NULL)
- g_free (panel->applets_using_hint);
- panel->applets_using_hint = NULL;
+ g_clear_pointer (&panel->applets_hints, g_free);
+ g_clear_pointer (&panel->applets_using_hint, g_free);
G_OBJECT_CLASS (panel_widget_parent_class)->finalize (obj);
}