Skip to content

Commit

Permalink
WINE-MONO HACK: Use ProcessExit() in System.Environment.Exit
Browse files Browse the repository at this point in the history
  • Loading branch information
ivyl committed Apr 8, 2024
1 parent d101636 commit a73208a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mono/metadata/icall.c
Original file line number Diff line number Diff line change
Expand Up @@ -7308,7 +7308,18 @@ ves_icall_System_Environment_Exit (int result)
mono_runtime_quit_internal ();

/* we may need to do some cleanup here... */

#ifdef HOST_WIN32
/*
* Wine msvcrt's exit() calls CorExitProcess() if mscoree is loaded.
* This in turn tries to gracefully call System.Environment.Exit for
* each loaded runtime ending up in a circular dependency if we need to
* hard-quit. Because of that we have to use ExitProcess() directly here.
* */
ExitProcess (result);
#else
exit (result);
#endif
}

void
Expand Down

0 comments on commit a73208a

Please sign in to comment.