Code optimize
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-util.c
old mode 100644 (file)
new mode 100755 (executable)
index 5afbc4e..5fb2214
@@ -1,13 +1,11 @@
 /*
- * bluetooth-frwk
- *
- * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *              http://www.apache.org/licenses/LICENSE-2.0
+ *             http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  */
 
 #include <string.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus.h>
 #include <glib.h>
 #include <dlog.h>
+#include <gio/gio.h>
 
 #include "bluetooth-api.h"
 #include "bt-service-common.h"
@@ -84,12 +81,11 @@ void _bt_init_request_list(void)
 
 /* insert request next to head */
 int _bt_insert_request_list(int req_id, int service_function,
-                       char *name, DBusGMethodInvocation *context)
+                       char *name, GDBusMethodInvocation *context)
 {
        request_info_t *info;
 
        info = g_malloc0(sizeof(request_info_t));
-
        info->req_id = req_id;
        info->service_function = service_function;
        info->context = context;
@@ -129,6 +125,7 @@ int _bt_delete_request_list(int req_id)
 
                if (info->req_id == req_id) {
                        req_list = g_slist_remove(req_list, info);
+                       _bt_delete_request_id(info->req_id);
                        g_free(info);
                        return BLUETOOTH_ERROR_NONE;
                }