diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-09-06 14:27:51 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-10-11 18:38:52 +0100 |
commit | ad7b669829d3d74cd508e3ec017b5fa11ef9c088 (patch) | |
tree | e2e32d64834149fc489b3b3c2fe2166e041d62ba /telepathy-glib/base-room-config.c | |
parent | 8f683e81f687b8f6dc4f943e57297ddfb8efc951 (diff) | |
download | telepathy-glib-ad7b669829d3d74cd508e3ec017b5fa11ef9c088.tar.gz |
BaseRoomConfig: improve find_myself error checking
TpBaseRoomConfig stores a pointer to itself as qdata on its parent
channel. It did not previously NULL that pointer out when it was
disposed: it now does.
Correspondingly, I added an explicit check for NULL to find_myself().
While this is technically redundant with the TP_IS_BASE_ROOM_CONFIG()
check, I think it makes the error message clearer to distinguish between
the two.
Diffstat (limited to 'telepathy-glib/base-room-config.c')
-rw-r--r-- | telepathy-glib/base-room-config.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/telepathy-glib/base-room-config.c b/telepathy-glib/base-room-config.c index b14d19c50..fef349146 100644 --- a/telepathy-glib/base-room-config.c +++ b/telepathy-glib/base-room-config.c @@ -451,7 +451,10 @@ find_myself (GObject *parent) { TpBaseRoomConfig *self = g_object_get_qdata (parent, find_myself_q); + DEBUG ("retrieved %p from channel %p", self, parent); + g_return_val_if_fail (TP_IS_BASE_CHANNEL (parent), NULL); + g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (TP_IS_BASE_ROOM_CONFIG (self), NULL); return self; @@ -481,6 +484,7 @@ tp_base_room_config_dispose (GObject *object) if (priv->channel != NULL) { + g_object_set_qdata (G_OBJECT (priv->channel), find_myself_q, NULL); g_object_weak_unref (G_OBJECT (priv->channel), channel_died_cb, self); priv->channel = NULL; } |