summaryrefslogtreecommitdiff
path: root/telepathy-glib/svc-interface-skeleton.c
diff options
context:
space:
mode:
Diffstat (limited to 'telepathy-glib/svc-interface-skeleton.c')
-rw-r--r--telepathy-glib/svc-interface-skeleton.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/telepathy-glib/svc-interface-skeleton.c b/telepathy-glib/svc-interface-skeleton.c
index 246baac51..9a2a92074 100644
--- a/telepathy-glib/svc-interface-skeleton.c
+++ b/telepathy-glib/svc-interface-skeleton.c
@@ -220,6 +220,8 @@ tp_svc_interface_skeleton_emit_signal (GClosure *closure,
SignalClosure *sc = (SignalClosure *) closure;
TpSvcInterfaceSkeleton *self = sc->self;
GDBusInterfaceSkeleton *skel = G_DBUS_INTERFACE_SKELETON (self);
+ GDBusConnection *connection =
+ g_dbus_interface_skeleton_get_connection (skel);
const gchar *path = g_dbus_interface_skeleton_get_object_path (skel);
GVariantBuilder builder;
guint i;
@@ -227,6 +229,12 @@ tp_svc_interface_skeleton_emit_signal (GClosure *closure,
DEBUG ("%s.%s from %s %p", self->priv->iinfo->interface_info->name,
sc->name, path, self);
+ if (path == NULL || connection == NULL)
+ {
+ DEBUG ("- ignoring, object no longer exported");
+ return;
+ }
+
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
/* Skip parameter 0, which is the GObject. */
@@ -235,10 +243,9 @@ tp_svc_interface_skeleton_emit_signal (GClosure *closure,
dbus_g_value_build_g_variant (param_values + i));
/* we only support being exported on one connection */
- g_dbus_connection_emit_signal (
- g_dbus_interface_skeleton_get_connection (skel),
+ g_dbus_connection_emit_signal (connection,
NULL, /* broadcast */
- g_dbus_interface_skeleton_get_object_path (skel),
+ path,
self->priv->iinfo->interface_info->name,
sc->name,
/* consume floating ref */