[glib] notify: Remove g_object_notify_queue_from_object()



commit 65797f7e54061a21866261d00a1c5533cd6a4f81
Author: Olivier Crête <olivier crete collabora co uk>
Date:   Thu Jul 22 21:20:35 2010 +0200

    notify: Remove g_object_notify_queue_from_object()
    
    The function will not be safe with object locking in place, so we remove
    it. The workaround is somewhat ugly, but it works.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=166020

 gobject/gobject.c            |   14 ++++++++------
 gobject/gobjectnotifyqueue.c |    7 -------
 2 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 77d12b7..f9280c2 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -978,12 +978,14 @@ g_object_thaw_notify (GObject *object)
     return;
   
   g_object_ref (object);
-  nqueue = g_object_notify_queue_from_object (object, &property_notify_context);
-  if (!nqueue || !nqueue->freeze_count)
-    g_warning ("%s: property-changed notification for %s(%p) is not frozen",
-	       G_STRFUNC, G_OBJECT_TYPE_NAME (object), object);
-  else
-    g_object_notify_queue_thaw (object, nqueue);
+
+  /* FIXME: Freezing is the only way to get at the notify queue.
+   * So we freeze once and then thaw twice.
+   */
+  nqueue = g_object_notify_queue_freeze (object,  &property_notify_context);
+  g_object_notify_queue_thaw (object, nqueue);
+  g_object_notify_queue_thaw (object, nqueue);
+
   g_object_unref (object);
 }
 
diff --git a/gobject/gobjectnotifyqueue.c b/gobject/gobjectnotifyqueue.c
index 8492b47..a343bb4 100644
--- a/gobject/gobjectnotifyqueue.c
+++ b/gobject/gobjectnotifyqueue.c
@@ -155,13 +155,6 @@ g_object_notify_queue_add (GObject            *object,
     }
 }
 
-static inline GObjectNotifyQueue*
-g_object_notify_queue_from_object (GObject              *object,
-				   GObjectNotifyContext *context)
-{
-  return g_datalist_id_get_data (&object->qdata, context->quark_notify_queue);
-}
-
 
 G_END_DECLS
 



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