[glib] Make GEmblem more robust



commit 34de9189f6f29dccbad8224a9605e4eb6d40b94e
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Dec 23 15:00:18 2013 -0500

    Make GEmblem more robust
    
    No reason not to survive g_object_unref (g_object_new (...)).

 gio/gemblem.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gio/gemblem.c b/gio/gemblem.c
index 7a835fa..2ce1fc1 100644
--- a/gio/gemblem.c
+++ b/gio/gemblem.c
@@ -122,7 +122,8 @@ g_emblem_finalize (GObject *object)
 {
   GEmblem *emblem = G_EMBLEM (object);
 
-  g_object_unref (emblem->icon);
+  if (emblem->icon)
+    g_object_unref (emblem->icon);
 
   (*G_OBJECT_CLASS (g_emblem_parent_class)->finalize) (object);
 }


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