Skip to content

Commit 9fc62b9

Browse files
committed
Calling fb_shutdown only on process exit (DNET-879).
1 parent 362f74e commit 9fc62b9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Provider/src/FirebirdSql.Data.FirebirdClient/Common/ShutdownHelper.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ static ShutdownHelper()
3030
_pools = new ConcurrentBag<Action>();
3131
_fbClients = new ConcurrentBag<Action>();
3232
#if !NETSTANDARD1_6
33-
AppDomain.CurrentDomain.DomainUnload += (sender, e) => HandleShutdown();
34-
AppDomain.CurrentDomain.ProcessExit += (sender, e) => HandleShutdown();
33+
AppDomain.CurrentDomain.DomainUnload += (sender, e) => HandleDomainUnload();
34+
AppDomain.CurrentDomain.ProcessExit += (sender, e) => HandleProcessShutdown();
3535
#endif
3636
}
3737

@@ -45,10 +45,15 @@ internal static void RegisterFbClientShutdown(Action item)
4545
_fbClients.Add(item);
4646
}
4747

48-
static void HandleShutdown()
48+
static void HandleDomainUnload()
4949
{
5050
foreach (var item in _pools)
5151
item();
52+
}
53+
54+
static void HandleProcessShutdown()
55+
{
56+
HandleDomainUnload();
5257
foreach (var item in _fbClients)
5358
item();
5459
}

0 commit comments

Comments
 (0)