free_hash (image->native_wrapper_aot_cache);
free_hash (image->pinvoke_scopes);
free_hash (image->pinvoke_scope_filenames);
+ free_hash (image->gsharedvt_types);
/* The ownership of signatures is not well defined */
g_hash_table_destroy (image->memberref_signatures);
if (image->property_hash)
mono_property_hash_destroy (image->property_hash);
- g_slist_free (image->reflection_info_unregister_classes);
+ /*
+ reflection_info_unregister_classes is only required by dynamic images, which will not be properly
+ cleared during shutdown as we don't perform regular appdomain unload for the root one.
+ */
+ g_assert (!image->reflection_info_unregister_classes || mono_runtime_is_shutting_down ());
image->reflection_info_unregister_classes = NULL;
if (image->interface_bitset) {
mono_image_close_finish (MonoImage *image)
{
int i;
- GSList *l;
-
- for (l = image->reflection_info_unregister_classes; l; l = l->next)
- g_free (l->data);
- g_slist_free (image->reflection_info_unregister_classes);
- image->reflection_info_unregister_classes = NULL;
if (image->references && !image->dynamic) {
for (i = 0; i < image->nreferences; i++) {
mono_property_hash_remove_object (image->property_hash, subject);
mono_image_unlock (image);
}
+
+void
+mono_image_append_class_to_reflection_info_set (MonoClass *class)
+{
+ MonoImage *image = class->image;
+ g_assert (image->dynamic);
+ mono_image_lock (image);
+ image->reflection_info_unregister_classes = g_slist_prepend_mempool (image->mempool, image->reflection_info_unregister_classes, class);
+ mono_image_unlock (image);
+}