summaryrefslogtreecommitdiff
path: root/applets/fish
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/fish
parent94f3ec8c654363cd6a245eb9dca7c54f1b8f5649 (diff)
downloadmate-panel-6fbabd51619c92bcd8584e1bb2f12f2b52904ea6.tar.bz2
mate-panel-6fbabd51619c92bcd8584e1bb2f12f2b52904ea6.tar.xz
Use g_clear_pointer() and g_clear_object()
Diffstat (limited to 'applets/fish')
-rw-r--r--applets/fish/fish.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/applets/fish/fish.c b/applets/fish/fish.c
index 2cded044..cfbdf3fa 100644
--- a/applets/fish/fish.c
+++ b/applets/fish/fish.c
@@ -1778,28 +1778,14 @@ static void fish_applet_dispose (GObject *object)
fish);
if (fish->timeout)
- {
g_source_remove (fish->timeout);
- }
-
fish->timeout = 0;
- if (fish->settings)
- g_object_unref (fish->settings);
- fish->settings = NULL;
-
- if (fish->lockdown_settings)
- g_object_unref (fish->lockdown_settings);
- fish->lockdown_settings = NULL;
-
- g_free (fish->name);
- fish->name = NULL;
-
- g_free (fish->image);
- fish->image = NULL;
-
- g_free (fish->command);
- fish->command = NULL;
+ g_clear_object (&fish->settings);
+ g_clear_object (&fish->lockdown_settings);
+ g_clear_pointer (&fish->name, g_free);
+ g_clear_pointer (&fish->image, g_free);
+ g_clear_pointer (&fish->command, g_free);
if (fish->surface)
cairo_surface_destroy (fish->surface);
@@ -1807,9 +1793,7 @@ static void fish_applet_dispose (GObject *object)
fish->surface_width = 0;
fish->surface_height = 0;
- if (fish->pixbuf)
- g_object_unref (fish->pixbuf);
- fish->pixbuf = NULL;
+ g_clear_object (&fish->pixbuf);
if (fish->preferences_dialog)
gtk_widget_destroy (fish->preferences_dialog);