if (type_h->aul_handle)
aul_screen_connector_remove_screen_viewer(type_h->aul_handle);
- if (type_h->toolkit_table)
+ if (type_h->toolkit_table) {
g_hash_table_destroy(type_h->toolkit_table);
+ type_h->toolkit_table = NULL;
+ }
free(type_h);
}
EXPORT_API int screen_connector_toolkit_init(screen_connector_screen_type_e type)
{
int ret = 0;
- int *key;
screen_connector_type_h type_h;
ret = screen_connector_trs_init();
if (__type_table == NULL)
- __type_table = g_hash_table_new_full(g_int_hash, g_int_equal, free, __destroy_type_h);
+ __type_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, __destroy_type_h);
- type_h = g_hash_table_lookup(__type_table, &type);
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
if (type_h == NULL) {
- key = (int *)calloc(1, sizeof(int));
- *key = type;
type_h = (screen_connector_type_h)calloc(1, sizeof(struct _screen_connector_type_h));
- g_hash_table_insert(__type_table, key, type_h);
+ g_hash_table_insert(__type_table, GINT_TO_POINTER(type), type_h);
}
return ret;
return 0;
}
- type_h = g_hash_table_lookup(__type_table, &type);
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
if (type_h)
- g_hash_table_remove(__type_table, &type);
+ g_hash_table_remove(__type_table, GINT_TO_POINTER(type));
if (g_hash_table_size(__type_table) == 0) {
ret = screen_connector_trs_fini();
return NULL;
}
- type_h = g_hash_table_lookup(__type_table, &type);
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
if (type_h == NULL) {
LOGE("type %d is not initialized !!", type);
return NULL;
if (!type_h)
return;
- if (type_h->toolkit_table)
+ if (type_h->toolkit_table) {
g_hash_table_destroy(type_h->toolkit_table);
+ type_h->toolkit_table = NULL;
+ }
free(type_h);
}
EXPORT_API int screen_connector_toolkit_evas_init(Evas_Object *win, screen_connector_screen_type_e type)
{
screen_connector_type_evas_h type_h;
- int *key;
if (__type_table == NULL)
- __type_table = g_hash_table_new_full(g_int_hash, g_int_equal, free, __destroy_type_h);
+ __type_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, __destroy_type_h);
- type_h = g_hash_table_lookup(__type_table, &type);
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
if (type_h == NULL) {
- key = (int *)calloc(1, sizeof(int));
- *key = type;
type_h = (screen_connector_type_evas_h)calloc(1, sizeof(struct _screen_connector_type_evas_h));
- g_hash_table_insert(__type_table, key, type_h);
+ g_hash_table_insert(__type_table, GINT_TO_POINTER(type), type_h);
type_h->toolkit_table = g_hash_table_new(g_direct_hash, g_direct_equal);
if (!type_h->toolkit_table) {
return 0;
}
- type_h = g_hash_table_lookup(__type_table, &type);
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
if (type_h) {
- if (type_h->toolkit_table)
+ if (type_h->toolkit_table) {
g_hash_table_destroy(type_h->toolkit_table);
- g_hash_table_remove(__type_table, &type);
+ type_h->toolkit_table = NULL;
+ }
+ g_hash_table_remove(__type_table, GINT_TO_POINTER(type));
}
if (g_hash_table_size(__type_table) == 0) {
screen_connector_type_evas_h type_h;
int int_type = type;
- type_h = g_hash_table_lookup(__type_table, &int_type);
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(int_type));
if (type_h == NULL) {
LOGE("type %d is not initialized !!", type);
return NULL;
screen_connector_type_evas_h type_h;
char rid_str[32];
- type_h = g_hash_table_lookup(__type_table, &type);
+ type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
if (type_h == NULL) {
LOGE("type %d is not initialized !!", type);
return NULL;