[gtk/wip/baedert/for-master: 43/56] scalebutton: Shorten finalize() implementation
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 43/56] scalebutton: Shorten finalize() implementation
- Date: Tue, 5 May 2020 06:24:25 +0000 (UTC)
commit a40abcf74d21fc96f526b61489a69ba15be5266f
Author: Timm Bäder <mail baedert org>
Date: Mon Apr 27 11:56:55 2020 +0200
scalebutton: Shorten finalize() implementation
gtk/gtkscalebutton.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index 4029279bf8..930b026406 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -512,20 +512,9 @@ gtk_scale_button_finalize (GObject *object)
GtkScaleButton *button = GTK_SCALE_BUTTON (object);
GtkScaleButtonPrivate *priv = gtk_scale_button_get_instance_private (button);
- if (priv->icon_list)
- {
- g_strfreev (priv->icon_list);
- priv->icon_list = NULL;
- }
-
- if (priv->adjustment)
- {
- g_object_unref (priv->adjustment);
- priv->adjustment = NULL;
- }
-
- if (priv->autoscroll_timeout)
- g_source_remove (priv->autoscroll_timeout);
+ g_clear_pointer (&priv->icon_list, g_strfreev);
+ g_clear_object (&priv->adjustment);
+ g_clear_handle_id (&priv->autoscroll_timeout, g_source_remove);
G_OBJECT_CLASS (gtk_scale_button_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]