Commit f240813f authored by James Henstridge's avatar James Henstridge Committed by James Henstridge

add an object member to the structure. (weak_refs_notify): pass

2001-08-17  James Henstridge  <james@daa.com.au>

	* gobject.c (WeakRefStack): add an object member to the structure.
	(weak_refs_notify): pass wstack->object as extra argument to
	notify functions.
	(g_object_weak_ref): set wstack->object when initialising
	WeakRefStack.

	* gobject.h (GWeakNotify): add second argument to prototype which
	gives the pointer to where the object that is being disposed of
	was.
parent 2da4b710
2001-08-17 James Henstridge <james@daa.com.au>
* gobject.c (WeakRefStack): add an object member to the structure.
(weak_refs_notify): pass wstack->object as extra argument to
notify functions.
(g_object_weak_ref): set wstack->object when initialising
WeakRefStack.
* gobject.h (GWeakNotify): add second argument to prototype which
gives the pointer to where the object that is being disposed of
was.
Wed Jul 18 19:42:31 2001 Tim Janik <timj@gtk.org>
* gtype.h: if __GNUC__ is defined, inline a test for an exact type
......
......@@ -1181,6 +1181,7 @@ g_object_disconnect (gpointer _object,
}
typedef struct {
GObject *object;
guint n_weak_refs;
struct {
GWeakNotify notify;
......@@ -1195,7 +1196,7 @@ weak_refs_notify (gpointer data)
guint i;
for (i = 0; i < wstack->n_weak_refs; i++)
wstack->weak_refs[i].notify (wstack->weak_refs[i].data);
wstack->weak_refs[i].notify (wstack->weak_refs[i].data, wstack->object);
g_free (wstack);
}
......@@ -1220,6 +1221,7 @@ g_object_weak_ref (GObject *object,
else
{
wstack = g_renew (WeakRefStack, NULL, 1);
wstack->object = object;
wstack->n_weak_refs = 1;
i = 0;
}
......
......@@ -54,7 +54,8 @@ typedef void (*GObjectSetPropertyFunc) (GObject *object,
const GValue *value,
GParamSpec *pspec);
typedef void (*GObjectFinalizeFunc) (GObject *object);
typedef void (*GWeakNotify) (gpointer data);
typedef void (*GWeakNotify) (gpointer data,
GObject *where_the_object_was);
struct _GObject
{
GTypeInstance g_type_instance;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment