summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-04-08 23:19:19 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-04-08 23:19:19 +0000
commit353376a06677af64fc6e81d3118adc2e059516b8 (patch)
tree04750057f8997acd704ba34dcb2843e170ce28b9 /audio
parent7558cca5c0bd954dc3db559c0d58ae6e497b13c0 (diff)
Fix some forgotton leftovers
Diffstat (limited to 'audio')
-rw-r--r--audio/headset.c7
-rw-r--r--audio/main.c2
-rw-r--r--audio/manager.c11
-rw-r--r--audio/manager.h2
4 files changed, 16 insertions, 6 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 9e303782..44a6ce03 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -112,7 +112,6 @@ struct manager {
};
static DBusConnection *connection = NULL;
-static GMainLoop *main_loop = NULL;
struct manager *audio_manager_new(DBusConnection *conn);
void audio_manager_free(struct manager *manager);
@@ -1973,8 +1972,7 @@ int headset_init(DBusConnection *conn)
if (!manager) {
error("Failed to create an audio manager");
dbus_connection_unref(connection);
- g_main_loop_unref(main_loop);
- exit(1);
+ return -1;
}
audio_manager_create_headset_server(manager, 12);
@@ -1985,7 +1983,10 @@ int headset_init(DBusConnection *conn)
void headset_exit(void)
{
audio_manager_free(manager);
+
manager = NULL;
dbus_connection_unref(connection);
+
+ connection = NULL;
}
diff --git a/audio/main.c b/audio/main.c
index 08194d82..bf0ddf4d 100644
--- a/audio/main.c
+++ b/audio/main.c
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
exit(1);
}
- audio_init();
+ audio_init(conn);
headset_init(conn);
diff --git a/audio/manager.c b/audio/manager.c
index 7c7a92c0..32eea81b 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -25,13 +25,22 @@
#include <config.h>
#endif
+#include <dbus/dbus.h>
+
#include "manager.h"
-int audio_init(void)
+static DBusConnection *connection = NULL;
+
+int audio_init(DBusConnection *conn)
{
+ connection = dbus_connection_ref(conn);
+
return 0;
}
void audio_exit(void)
{
+ dbus_connection_unref(connection);
+
+ connection = NULL;
}
diff --git a/audio/manager.h b/audio/manager.h
index 3f2988f9..f97b563a 100644
--- a/audio/manager.h
+++ b/audio/manager.h
@@ -21,5 +21,5 @@
*
*/
-int audio_init(void);
+int audio_init(DBusConnection *conn);
void audio_exit(void);