Modify dbus policies
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / oal-manager.c
index 83a4ab5..56b821f 100644 (file)
@@ -84,8 +84,12 @@ oal_status_t oal_bt_init(oal_event_callback cb)
 void oal_bt_deinit(void)
 {
        BT_INFO("+");
-       blued_api->cleanup();
-       blued_api = NULL;
+       if (blued_api) {
+               blued_api->cleanup();
+               blued_api = NULL;
+       }
+       _bt_event_dispatcher_deinit();
+       sleep(1);
        unload_libs(NULL);
        BT_INFO("-");
 }