tethering_enabled_cb ecb = th->enabled_cb[TETHERING_TYPE_WIFI];
void *data = th->enabled_user_data[TETHERING_TYPE_WIFI];
+ if (!_tethering_check_handle((tethering_h)user_data))
+ return;
+
g_var = g_dbus_proxy_call_finish(th->client_bus_proxy, res, &g_error);
if (g_error) {
//LCOV_EXCL_START
tethering_enabled_cb ecb = th->enabled_cb[TETHERING_TYPE_BT];
void *data = th->enabled_user_data[TETHERING_TYPE_BT];
+ if (!_tethering_check_handle((tethering_h)user_data))
+ return;
+
g_var = g_dbus_proxy_call_finish(th->client_bus_proxy, res, &g_error);
if (g_error) {
//LCOV_EXCL_START
tethering_enabled_cb ecb = th->enabled_cb[TETHERING_TYPE_USB];
void *data = th->enabled_user_data[TETHERING_TYPE_USB];
+ if (!_tethering_check_handle((tethering_h)user_data))
+ return;
+
g_var = g_dbus_proxy_call_finish(th->client_bus_proxy, res, &g_error);
if (g_error) {
ERR("DBus error [%s]\n", g_error->message);
tethering_enabled_cb ecb = th->enabled_cb[TETHERING_TYPE_P2P];
void *data = th->enabled_user_data[TETHERING_TYPE_P2P];
+ if (!_tethering_check_handle((tethering_h)user_data))
+ return;
+
g_var = g_dbus_proxy_call_finish(th->client_bus_proxy, res, &g_error);
if (g_error) {
ERR("DBus error [%s]\n", g_error->message);
tethering_disabled_cb dcb = NULL;
void *data = NULL;
+ if (!_tethering_check_handle((tethering_h)user_data))
+ return;
+
g_var = g_dbus_proxy_call_finish(th->client_bus_proxy, res, &g_error);
if (g_error) {
//LCOV_EXCL_START
__connect_signals((tethering_h)th);
*tethering = (tethering_h)th;
+ _tethering_add_handle(th);
INFO("Tethering Handle : 0x%X\n", th);
INFO("-\n");
return TETHERING_ERROR_NONE;
g_object_unref(th->client_bus_proxy);
g_object_unref(th->client_bus);
memset(th, 0x00, sizeof(__tethering_h));
+
+ _tethering_remove_handle(th);
free(th);
INFO("-\n");
static __thread bool is_feature_checked[TETHERING_SUPPORTED_FEATURE_MAX] = {0, };
static __thread bool feature_supported[TETHERING_SUPPORTED_FEATURE_MAX] = {0, };
+static __thread GSList *tethering_handle_list = NULL;
bool __check_feature_supported(const char *key, tethering_supported_feature_e feature)
{
return TETHERING_ERROR_NONE;
}
+
+void _tethering_add_handle(tethering_h handle)
+{
+ tethering_handle_list = g_slist_append(tethering_handle_list, handle);
+}
+
+void _tethering_remove_handle(tethering_h handle)
+{
+ tethering_handle_list = g_slist_remove(tethering_handle_list, handle);
+}
+
+bool _tethering_check_handle(tethering_h handle)
+{
+ if (g_slist_find(tethering_handle_list, handle) != NULL)
+ return true;
+ else
+ return false;
+}
+