Skip to content

Commit

Permalink
[mono] Don't leak coop handles, fix type in managed ALC struct (dotne…
Browse files Browse the repository at this point in the history
…t#41159)

* Don't leak coop handle

* Fix type in MonoManagedAssemblyLoadContext
  • Loading branch information
CoffeeFlux authored Aug 22, 2020
1 parent 73e8efb commit 9f75120
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/mono/mono/metadata/assembly-load-context.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ mono_alc_is_default (MonoAssemblyLoadContext *alc)
MonoAssemblyLoadContext *
mono_alc_from_gchandle (MonoGCHandle alc_gchandle)
{
HANDLE_FUNCTION_ENTER ();
MonoManagedAssemblyLoadContextHandle managed_alc = MONO_HANDLE_CAST (MonoManagedAssemblyLoadContext, mono_gchandle_get_target_handle (alc_gchandle));
MonoAssemblyLoadContext *alc = (MonoAssemblyLoadContext *)MONO_HANDLE_GETVAL (managed_alc, native_assembly_load_context);
return alc;
MonoAssemblyLoadContext *alc = MONO_HANDLE_GETVAL (managed_alc, native_assembly_load_context);
HANDLE_FUNCTION_RETURN_VAL (alc);
}

MonoGCHandle
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/object-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ typedef struct {
MonoEvent *resolving;
MonoEvent *unloading;
MonoString *name;
gpointer *native_assembly_load_context;
MonoAssemblyLoadContext *native_assembly_load_context;
gint64 id;
gint32 internal_state;
MonoBoolean is_collectible;
Expand Down

0 comments on commit 9f75120

Please sign in to comment.