type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type));
if (type_h == NULL) {
-
type_h = (screen_connector_type_evas_h)calloc(1, sizeof(struct _screen_connector_type_evas_h));
- g_hash_table_insert(__type_table, GINT_TO_POINTER(type), type_h);
+ if (type_h == NULL) {
+ LOGE("Out of memory");
+ return -1;
+ }
type_h->toolkit_table = g_hash_table_new(g_direct_hash, g_direct_equal);
if (!type_h->toolkit_table) {
LOGE("failed to create table");
+ free(type_h);
return -1;
}
+ g_hash_table_insert(__type_table, GINT_TO_POINTER(type), type_h);
}
type_h->viewer_win = win;