diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-03-31 18:44:47 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-04-08 16:35:09 +0200 |
commit | 84e3ea63b9fe3d15862ab79ad401474330c28454 (patch) | |
tree | 15995404fff7309925ba7c67bbc8e40a43fecd5e | |
parent | aab6a46515f28c9459b08a7db30a5dc7984ffc71 (diff) |
base-call: set dbus id as soon as object is created
-rw-r--r-- | src/mm-base-call.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mm-base-call.c b/src/mm-base-call.c index 6966e94a..56cd97f9 100644 --- a/src/mm-base-call.c +++ b/src/mm-base-call.c @@ -54,6 +54,8 @@ static GParamSpec *properties[PROP_LAST]; struct _MMBaseCallPrivate { /* The connection to the system bus */ GDBusConnection *connection; + guint dbus_id; + /* The modem which owns this call */ MMBaseModem *modem; /* The path where the call object is exported */ @@ -856,10 +858,9 @@ handle_send_dtmf (MMBaseCall *self, void mm_base_call_export (MMBaseCall *self) { - static guint id = 0; gchar *path; - path = g_strdup_printf (MM_DBUS_CALL_PREFIX "/%d", id++); + path = g_strdup_printf (MM_DBUS_CALL_PREFIX "/%d", self->priv->dbus_id); g_object_set (self, MM_BASE_CALL_PATH, path, NULL); @@ -1439,8 +1440,13 @@ get_property (GObject *object, static void mm_base_call_init (MMBaseCall *self) { + static guint id = 0; + /* Initialize private data */ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_BASE_CALL, MMBaseCallPrivate); + + /* Each call is given a unique id to build its own DBus path */ + self->priv->dbus_id = id++; } static void |