summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-01-18 13:45:01 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-12 12:30:41 +0200
commitd59a3d1e54b1b23ce6666009565bf0426e46ecad (patch)
treea7b8daeabf0ff271bb335089c5442b0c041e1f42
parent15d953c08e40baa252e31b07d5c61565c841a3e3 (diff)
core features can't have explicit depends
This avoid cyclic references and weird corner cases.
-rw-r--r--telepathy-glib/proxy.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/telepathy-glib/proxy.c b/telepathy-glib/proxy.c
index 28230d29..20e27b4f 100644
--- a/telepathy-glib/proxy.c
+++ b/telepathy-glib/proxy.c
@@ -953,6 +953,17 @@ tp_proxy_set_feature_state (TpProxy *self,
GINT_TO_POINTER (state));
}
+static void
+check_feature_validity (TpProxy *self,
+ const TpProxyFeature *feature)
+{
+ g_assert (feature != NULL);
+
+ /* Core features can't have depends, their depends are implicit */
+ if (feature->core)
+ g_assert (feature->depends_on == NULL || feature->depends_on[0] == 0);
+}
+
static GObject *
tp_proxy_constructor (GType type,
guint n_params,
@@ -996,6 +1007,8 @@ tp_proxy_constructor (GType type,
for (i = 0; features[i].name != 0; i++)
{
+ check_feature_validity (self, &features[i]);
+
tp_proxy_set_feature_state (self, features[i].name,
FEATURE_STATE_UNWANTED);