[gnome-applets/wip/segeiger/windowpicker: 1/7] windowpicker: simplify wp_applet_dispose



commit 241b21250e1ef33701059191d372d8620dfa1414
Author: Sebastian Geiger <sbastig gmx net>
Date:   Tue Oct 8 22:04:18 2019 +0200

    windowpicker: simplify wp_applet_dispose

 windowpicker/src/wp-applet.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/windowpicker/src/wp-applet.c b/windowpicker/src/wp-applet.c
index 2a2b1b6e9..20ea11a23 100644
--- a/windowpicker/src/wp-applet.c
+++ b/windowpicker/src/wp-applet.c
@@ -296,18 +296,8 @@ wp_applet_dispose (GObject *object)
   applet = WP_APPLET (object);
 
   g_clear_object (&applet->settings);
-
-  if (applet->about_dialog != NULL)
-    {
-      gtk_widget_destroy (applet->about_dialog);
-      applet->about_dialog = NULL;
-    }
-
-  if (applet->preferences_dialog != NULL)
-    {
-      gtk_widget_destroy (applet->preferences_dialog);
-      applet->preferences_dialog = NULL;
-    }
+  g_clear_pointer (&applet->about_dialog, gtk_widget_destroy);
+  g_clear_pointer (&applet->preferences_dialog, gtk_widget_destroy);
 
   G_OBJECT_CLASS (wp_applet_parent_class)->dispose (object);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]