image->property_hash = mono_property_hash_new ();
InitializeCriticalSection (&image->lock);
+ InitializeCriticalSection (&image->szarray_cache_lock);
}
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
g_hash_table_foreach (image->array_cache, free_array_cache_entry, NULL);
g_hash_table_destroy (image->array_cache);
}
+ if (image->szarray_cache)
+ g_hash_table_destroy (image->szarray_cache);
if (image->ptr_cache)
g_hash_table_destroy (image->ptr_cache);
if (image->name_cache) {
g_free (image->references);
mono_perfcounters->loader_bytes -= mono_mempool_get_allocated (image->mempool);
+ DeleteCriticalSection (&image->szarray_cache_lock);
DeleteCriticalSection (&image->lock);
/*g_print ("destroy image %p (dynamic: %d)\n", image, image->dynamic);*/
dir_offset = MONO_PE_RES_DIR_ENTRY_DIR_OFFSET (*entry);
if(level==0) {
- if((is_string==FALSE && name_offset!=res_id) ||
- (is_string==TRUE)) {
- return(NULL);
- }
+ if (is_string)
+ return NULL;
} else if (level==1) {
+ if (res_id != name_offset)
+ return NULL;
#if 0
if(name!=NULL &&
is_string==TRUE && name!=lookup (name_offset)) {
}
#endif
} else if (level==2) {
- if ((is_string == FALSE &&
- name_offset != lang_id &&
- lang_id != 0) ||
- (is_string == TRUE)) {
- return(NULL);
- }
+ if (is_string == TRUE || (is_string == FALSE && lang_id != 0 && name_offset != lang_id))
+ return NULL;
} else {
g_assert_not_reached ();
}
return(NULL);
}
+ mono_image_ensure_section_idx (image, MONO_SECTION_RSRC);
+
info=image->image_info;
if(info==NULL) {
return(NULL);