DBG("owner %s path %s", counter->owner, counter->path);
- if (counter->watch > 0)
- g_dbus_remove_watch(connection, counter->watch);
-
__connman_rtnl_update_interval_remove(counter->interval);
__connman_service_counter_unregister(counter->path);
if (g_strcmp0(owner, counter->owner) != 0)
return -EACCES;
+ if (counter->watch > 0)
+ g_dbus_remove_watch(connection, counter->watch);
+
g_hash_table_remove(owner_mapping, counter->owner);
g_hash_table_remove(counter_table, counter->path);
DBG("owner %s path %s", counter->owner, counter->path);
+ if (counter->watch > 0)
+ g_dbus_remove_watch(connection, counter->watch);
+
message = dbus_message_new_method_call(counter->owner, counter->path,
CONNMAN_COUNTER_INTERFACE, "Release");
if (message == NULL)
{
struct connman_session *session = user_data;
- if (session->watch > 0)
- g_dbus_remove_watch(connection, session->watch);
-
session->bearer = NULL;
if (session->service)
connman_service_unref(session->service);
g_hash_table_remove(bearer_hash, bearer);
}
+ if (session->watch > 0)
+ g_dbus_remove_watch(connection, session->watch);
+
g_hash_table_remove(session_hash, session);
return 0;