[gtk+] Use g_clear_object() shorthand for unref-and-set-to-null



commit bbe475fd971c0677776a5bc3d0ea35c9546a0f50
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Sat Aug 2 05:16:09 2014 +0000

    Use g_clear_object() shorthand for unref-and-set-to-null
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733766

 gtk/gtkwin32embedwidget.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkwin32embedwidget.c b/gtk/gtkwin32embedwidget.c
index 84ca00b..7884926 100644
--- a/gtk/gtkwin32embedwidget.c
+++ b/gtk/gtkwin32embedwidget.c
@@ -134,11 +134,7 @@ gtk_win32_embed_widget_unrealize (GtkWidget *widget)
 
   embed_widget->old_window_procedure = NULL;
   
-  if (embed_widget->parent_window != NULL)
-    {
-      g_object_unref (embed_widget->parent_window);
-      embed_widget->parent_window = NULL;
-    }
+  g_clear_object (&embed_widget->parent_window);
 
   GTK_WIDGET_CLASS (gtk_win32_embed_widget_parent_class)->unrealize (widget);
 }


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