diff options
author | Luiz Augusto von Dentz <luiz.dentz@indt.org.br> | 2008-07-30 17:57:50 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@indt.org.br> | 2008-07-30 17:57:50 -0300 |
commit | d0c561820ca05cafc8a7d20e3250953b48aa5214 (patch) | |
tree | f653006e6617f4f89c9bc60d4451df323bf1a08c /audio/control.c | |
parent | 990b22de8763ca1b23a6c2911dcd3ca30592ac3f (diff) |
Remove use of g_dbus_unregister_all_interfaces.
Diffstat (limited to 'audio/control.c')
-rw-r--r-- | audio/control.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/audio/control.c b/audio/control.c index 02fb8cd1..2a5e5e23 100644 --- a/audio/control.c +++ b/audio/control.c @@ -915,12 +915,39 @@ static GDBusSignalTable control_signals[] = { { NULL, NULL } }; +static void control_free(struct audio_device *dev) +{ + struct control *control = dev->control; + + if (control->session) + avctp_unref(control->session); + + g_free(control); + dev->control = NULL; +} + +static void path_unregister(void *data) +{ + struct audio_device *dev = data; + + info("Unregistered interface %s on path %s", + AUDIO_CONTROL_INTERFACE, dev->path); + + control_free(dev); +} + +void control_unregister(struct audio_device *dev) +{ + g_dbus_unregister_interface(dev->conn, dev->path, + AUDIO_CONTROL_INTERFACE); +} + struct control *control_init(struct audio_device *dev) { if (!g_dbus_register_interface(dev->conn, dev->path, AUDIO_CONTROL_INTERFACE, control_methods, control_signals, NULL, - dev, NULL)) + dev, path_unregister)) return NULL; info("Registered interface %s on path %s", @@ -929,17 +956,6 @@ struct control *control_init(struct audio_device *dev) return g_new0(struct control, 1); } -void control_free(struct audio_device *dev) -{ - struct control *control = dev->control; - - if (control->session) - avctp_unref(control->session); - - g_free(control); - dev->control = NULL; -} - gboolean control_is_active(struct audio_device *dev) { struct control *control = dev->control; |