mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
Merge branch 'object-weak-ref-docs' into 'main'
gobject: Document it’s unsafe to call g_object_ref() from GWeakNotify See merge request GNOME/glib!2246
This commit is contained in:
@@ -238,6 +238,11 @@ typedef void (*GObjectFinalizeFunc) (GObject *object);
|
||||
* Since the object is already being 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.
|
||||
*
|
||||
* In particular, this means it’s invalid to call g_object_ref(),
|
||||
* g_weak_ref_init(), g_weak_ref_set(), g_object_add_toggle_ref(),
|
||||
* g_object_weak_ref(), g_object_add_weak_pointer() or any function which calls
|
||||
* them on the object from this callback.
|
||||
*/
|
||||
typedef void (*GWeakNotify) (gpointer data,
|
||||
GObject *where_the_object_was);
|
||||
|
Reference in New Issue
Block a user