Skip to content

Commit

Permalink
Update AppContext.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalStrehovsky authored Dec 6, 2023
1 parent 1994089 commit dd81724
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libraries/System.Private.CoreLib/src/System/AppContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ internal static void OnFirstChanceException(object e)
// AppDomain brings lots of unnecessary dependencies into trimmed apps.
// The indirection is set up when the callback is installed so that
// only apps that install a callback have AppDomain in the closure.
private static Action s_invokeProcessExitCallback;
private static Action? s_invokeProcessExitCallback;

internal static void AddProcessExitCallback(EventHandler eventHandler)
internal static void AddProcessExitCallback(EventHandler? eventHandler)
{
s_processExit += eventHandler;
s_invokeProcessExitCallback ??= () => s_processExit?.Invoke(AppDomain.CurrentDomain, EventArgs.Empty);
}

internal static void RemoveProcessExitCallback(EventHandler eventHandler)
internal static void RemoveProcessExitCallback(EventHandler? eventHandler)
{
s_processExit -= eventHandler;
}
Expand Down

0 comments on commit dd81724

Please sign in to comment.