[glib: 1/3] Clarify in g_object_weak_ref() docs that the callback is called during disposing and not finalizing




commit a2de4b24792e6aa62821bceeb5f60ea83a551c4a
Author: Sebastian Dröge <sebastian centricular com>
Date:   Tue Dec 8 18:09:50 2020 +0200

    Clarify in g_object_weak_ref() docs that the callback is called during disposing and not finalizing
    
    This especially has the effect that any GWeakRefs to the object will not
    necessarily be set to NULL yet if called as part of
    g_object_run_dispose() and not as part of g_object_unref().

 gobject/gobject.c | 2 +-
 gobject/gobject.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 863d5b67a..2617dca3e 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -2975,7 +2975,7 @@ weak_refs_notify (gpointer data)
  * @data: extra data to pass to notify
  *
  * Adds a weak reference callback to an object. Weak references are
- * used for notification when an object is finalized. They are called
+ * used for notification when an object is disposed. They are called
  * "weak references" because they allow you to safely hold a pointer
  * to an object without calling g_object_ref() (g_object_ref() adds a
  * strong reference, that is, forces the object to stay alive).
diff --git a/gobject/gobject.h b/gobject/gobject.h
index a84c183f8..aec8975e4 100644
--- a/gobject/gobject.h
+++ b/gobject/gobject.h
@@ -227,11 +227,11 @@ typedef void (*GObjectFinalizeFunc)     (GObject      *object);
 /**
  * GWeakNotify:
  * @data: data that was provided when the weak reference was established
- * @where_the_object_was: the object being finalized
+ * @where_the_object_was: the object being disposed
  * 
  * A #GWeakNotify function can be added to an object as a callback that gets
  * triggered when the object is finalized. Since the object is already being
- * finalized when the #GWeakNotify is called, there's not much you could do 
+ * disposed when the #GWeakNotify is called, there's not much you could do 
  * with the object, apart from e.g. using its address as hash-index or the like. 
  */
 typedef void (*GWeakNotify)            (gpointer      data,


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