[gnome-builder/wip/libide] libide: use ide_set_weak_pointer()



commit 1124c95790c620f3118f5d22aa37aaf7cfc4dfb3
Author: Christian Hergert <christian hergert me>
Date:   Mon Feb 16 13:49:58 2015 -0800

    libide: use ide_set_weak_pointer()

 libide/ide-object.c |   17 +----------------
 1 files changed, 1 insertions(+), 16 deletions(-)
---
diff --git a/libide/ide-object.c b/libide/ide-object.c
index 149d1e1..6e92bb9 100644
--- a/libide/ide-object.c
+++ b/libide/ide-object.c
@@ -72,22 +72,7 @@ ide_object_set_context (IdeObject  *object,
   g_return_if_fail (IDE_IS_OBJECT (object));
   g_return_if_fail (IDE_IS_CONTEXT (context));
 
-  if (context != priv->context)
-    {
-      if (priv->context)
-        {
-          g_object_remove_weak_pointer (G_OBJECT (priv->context),
-                                        (gpointer *)&priv->context);
-          priv->context = NULL;
-        }
-
-      if (context)
-        {
-          priv->context = context;
-          g_object_add_weak_pointer (G_OBJECT (priv->context),
-                                     (gpointer *)&priv->context);
-        }
-    }
+  ide_set_weak_pointer (&priv->context, context);
 }
 
 static void


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