summaryrefslogtreecommitdiff
path: root/telepathy-glib/observe-channels-context.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-28 11:11:21 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-29 09:11:47 +0200
commitc71f643a8edd591dfa53b02b39d82aa3d1dd6ff4 (patch)
treec5697d16a750c672a023c27e486ca978f8233723 /telepathy-glib/observe-channels-context.c
parent8d94ea2670a26de020477b04dfa6efa59486b896 (diff)
downloadtelepathy-glib-c71f643a8edd591dfa53b02b39d82aa3d1dd6ff4.tar.gz
raise NotImplemented error when disposing a context in the 'none' or 'delayed' state
Diffstat (limited to 'telepathy-glib/observe-channels-context.c')
-rw-r--r--telepathy-glib/observe-channels-context.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/telepathy-glib/observe-channels-context.c b/telepathy-glib/observe-channels-context.c
index e40e7dd76..546d9f086 100644
--- a/telepathy-glib/observe-channels-context.c
+++ b/telepathy-glib/observe-channels-context.c
@@ -95,6 +95,19 @@ tp_observe_channels_context_dispose (GObject *object)
void (*dispose) (GObject *) =
G_OBJECT_CLASS (tp_observe_channels_context_parent_class)->dispose;
+ if (self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE ||
+ self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_DELAYED)
+ {
+ GError error = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
+ "Disposing the TpObserveChannelsContext" };
+
+ g_warning ("Disposing a context in the %s state",
+ self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE ?
+ "none": "delayed");
+
+ tp_observe_channels_context_fail (self, &error);
+ }
+
if (self->account != NULL)
{
g_object_unref (self->account);