static void __free_request_cb_info(gpointer data)
{
+ int req_id;
struct package_manager_request_cb_info *cb_info =
(struct package_manager_request_cb_info *)data;
+ req_id = cb_info->req_id;
free(cb_info);
cb_info = NULL;
- _LOGD("request callback info removed");
+ _LOGD("request callback info removed, req_id(%d)", req_id);
}
static void __initialize_request_cb_table(void)
{
__request_cb_table =
- g_hash_table_new_full(g_int_hash, g_int_equal, __free_request_cb_info, NULL);
+ g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, __free_request_cb_info);
}
static int __insert_request_cb_info(int req_id, package_manager_request_event_cb callback, void *user_data)
cb_info->req_id = req_id;
cb_info->callback = callback;
cb_info->user_data = user_data;
- g_hash_table_insert(__request_cb_table, &cb_info->req_id, cb_info);
+ g_hash_table_insert(__request_cb_table, GINT_TO_POINTER(cb_info->req_id), cb_info);
return 0;
}
_LOGD("request callback called, req_id[%d]", req_id);
package_manager_request_h request = data;
- cb_info = g_hash_table_lookup(__request_cb_table, &req_id);
+ cb_info = g_hash_table_lookup(__request_cb_table, GINT_TO_POINTER(req_id));
if (!cb_info || (cb_info && !cb_info->callback)) {
_LOGE("no callback info");
return 0;
} else {
_LOGE("unexpected end event");
}
- g_hash_table_remove(__request_cb_table, &req_id);
+ g_hash_table_remove(__request_cb_table, GINT_TO_POINTER(req_id));
}
return 0;