diff options
author | Timm Bäder <mail@baedert.org> | 2018-11-13 20:53:14 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-11-13 20:53:14 +0100 |
commit | 359d874ddbbc193fd0490fcfe18e96bc1b89619b (patch) | |
tree | 6609af8091a20bb4ed045b4c1e8b5a7aceae94f9 /gtk/gtkmenuitem.c | |
parent | ade171a2ed1f868b13dd1f1cb221e6622b92e052 (diff) | |
download | gtk+-359d874ddbbc193fd0490fcfe18e96bc1b89619b.tar.gz |
Use g_clear_pointer to unparent widgets
Diffstat (limited to 'gtk/gtkmenuitem.c')
-rw-r--r-- | gtk/gtkmenuitem.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index 34642a6cac..f1843ab349 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -745,12 +745,7 @@ gtk_menu_item_dispose (GObject *object) g_clear_object (&priv->motion_controller); g_clear_object (&priv->action_helper); - - if (priv->arrow_widget) - { - gtk_widget_unparent (priv->arrow_widget); - priv->arrow_widget = NULL; - } + g_clear_pointer (&priv->arrow_widget, gtk_widget_unparent); G_OBJECT_CLASS (gtk_menu_item_parent_class)->dispose (object); } @@ -846,11 +841,7 @@ gtk_menu_item_detacher (GtkWidget *widget, g_return_if_fail (priv->submenu == (GtkWidget*) menu); priv->submenu = NULL; - if (priv->arrow_widget) - { - gtk_widget_unparent (priv->arrow_widget); - priv->arrow_widget = NULL; - } + g_clear_pointer (&priv->arrow_widget, gtk_widget_unparent); } static void |