diff --git a/src/manager.c b/src/manager.c
index 90e6e6b..f1f0f4d 100644
--- a/src/manager.c
+++ b/src/manager.c
btd_adapter_unref(adapter);
}
+ btd_profile_cleanup();
+
btd_start_exit_timer();
g_dbus_unregister_interface(btd_get_dbus_connection(),
diff --git a/src/profile.c b/src/profile.c
index aa76a91..fa1b0a0 100644
--- a/src/profile.c
+++ b/src/profile.c
#include <stdbool.h>
#include <stdint.h>
+#include <errno.h>
#include <glib.h>
#include <dbus/dbus.h>
+#include <gdbus.h>
#include "uuid.h"
+#include "log.h"
#include "error.h"
+#include "dbus-common.h"
#include "adapter.h"
#include "device.h"
#include "profile.h"
return dbus_message_new_method_return(msg);
}
+
+void btd_profile_cleanup(void)
+{
+ while (ext_profiles) {
+ struct ext_profile *ext = ext_profiles->data;
+ DBusMessage *msg;
+
+ msg = dbus_message_new_method_call(ext->owner, ext->path,
+ "org.bluez.Profile",
+ "Release");
+ if (msg)
+ g_dbus_send_message(btd_get_dbus_connection(), msg);
+
+ remove_ext(ext);
+ }
+}
diff --git a/src/profile.h b/src/profile.h
index 12d2b3e..1702901 100644
--- a/src/profile.h
+++ b/src/profile.h
int btd_profile_register(struct btd_profile *profile);
void btd_profile_unregister(struct btd_profile *profile);
+void btd_profile_cleanup(void);
+
DBusMessage *btd_profile_reg_ext(DBusConnection *conn, DBusMessage *msg,
void *user_data);
DBusMessage *btd_profile_unreg_ext(DBusConnection *conn, DBusMessage *msg,