Skip to content

Commit

Permalink
[mono] Fix dotnet#52718. (dotnet#52724)
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz authored May 14, 2021
1 parent 70047a6 commit d259b7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
mono_defaults.internal_thread_class = mono_defaults.thread_class;

#if defined(HOST_DARWIN)
mono_defaults.autoreleasepool_class = mono_class_load_from_name (
mono_defaults.autoreleasepool_class = mono_class_try_load_from_name (
mono_defaults.corlib, "System.Threading", "AutoreleasePool");
#else
mono_defaults.autoreleasepool_class = NULL;
Expand Down
4 changes: 3 additions & 1 deletion src/mono/mono/metadata/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -3931,7 +3931,9 @@ mono_thread_init_from_native (void)
#if defined(HOST_DARWIN)
MonoInternalThread* thread = mono_thread_internal_current ();

g_assert (mono_defaults.autoreleasepool_class != NULL);
if (!mono_defaults.autoreleasepool_class)
return;

ERROR_DECL (error);
MONO_STATIC_POINTER_INIT (MonoMethod, create_autoreleasepool)

Expand Down

0 comments on commit d259b7a

Please sign in to comment.