contact = g_hash_table_lookup(_ctsvc_handle_table, key);
ctsvc_mutex_unlock(CTS_MUTEX_HANDLE);
- if (NULL == contact)
- {
+ if (NULL == contact) {
CTS_ERR("g_hash_table_lookup() return NULL");
return CONTACTS_ERROR_NO_DATA;
}
RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "_ctsvc_client_handle_get_key() Fail(%d)", ret);
ctsvc_mutex_lock(CTS_MUTEX_HANDLE);
- g_hash_table_remove(_ctsvc_handle_table, key);
+ if (false == g_hash_table_remove(_ctsvc_handle_table, key))
+ CTS_ERR("g_hash_table_remove() Fail. key:%s", key);
+
if (0 == g_hash_table_size(_ctsvc_handle_table)) {
g_hash_table_destroy(_ctsvc_handle_table);
_ctsvc_handle_table = NULL;
if (CONTACTS_ERROR_INVALID_PARAMETER == ret)
ret = CONTACTS_ERROR_IPC;
- if (0 == ((ctsvc_base_s *)contact)->connection_count) {
- ret = ctsvc_client_handle_remove(id, contact);
- WARN_IF(CONTACTS_ERROR_NONE != ret, "ctsvc_client_handle_remove() Fail(%d)", ret);
- }
-
return ret;
}
_ctsvc_connection--;
if (0 == base->connection_count) {
+ CTS_INFO("connection_count is 0. remove handle");
ret = ctsvc_client_handle_remove(ctsvc_client_get_pid(), contact);
WARN_IF(CONTACTS_ERROR_NONE != ret, "ctsvc_client_handle_remove() Fail(%d)", ret);
}
_ctsvc_connection_on_thread--;
+ if (0 == base->connection_count) {
+ CTS_INFO("connection_count is 0. remove handle");
+ ret = ctsvc_client_handle_remove(ctsvc_client_get_tid(), contact);
+ WARN_IF(CONTACTS_ERROR_NONE != ret, "ctsvc_client_handle_remove() Fail(%d)", ret);
+ }
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return CONTACTS_ERROR_NONE;
#define CTS_DBG(fmt, arg...)
#define CTS_WARN(fmt, arg...)
#define CTS_ERR(fmt, arg...) ERR(fmt, ##arg)
- #define CTS_INFO(fmt, arg...)
+ #define CTS_INFO(fmt, arg...) INFO(fmt, ##arg)
#define CTS_VERBOSE(fmt, arg...)
#define G_DISABLE_ASSERT