File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Provider/src/FirebirdSql.Data.FirebirdClient/FirebirdClient Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 2020using System . Collections . Generic ;
2121using System . Linq ;
2222using System . Threading ;
23- using System . Threading . Tasks ;
2423using FirebirdSql . Data . Common ;
2524
2625namespace FirebirdSql . Data . FirebirdClient
2726{
2827 sealed class FbConnectionPoolManager : IDisposable
2928 {
30- static Lazy < FbConnectionPoolManager > _instanceLazy = new Lazy < FbConnectionPoolManager > ( ( ) => new FbConnectionPoolManager ( ) , LazyThreadSafetyMode . ExecutionAndPublication ) ;
31-
32- internal static FbConnectionPoolManager Instance
33- {
34- get { return _instanceLazy . Value ; }
35- }
29+ internal static FbConnectionPoolManager Instance { get ; private set ; }
3630
3731 sealed class Pool : IDisposable
3832 {
@@ -187,6 +181,15 @@ FbConnectionInternal CreateNewConnectionIfPossibleImpl(FbConnectionString connec
187181 ConcurrentDictionary < string , Pool > _pools ;
188182 Timer _cleanupTimer ;
189183
184+ static FbConnectionPoolManager ( )
185+ {
186+ Instance = new FbConnectionPoolManager ( ) ;
187+ #if ! NETSTANDARD1_6
188+ AppDomain . CurrentDomain . DomainUnload += ( sender , args ) => Instance . Dispose ( ) ;
189+ AppDomain . CurrentDomain . ProcessExit += ( sender , args ) => Instance . Dispose ( ) ;
190+ #endif
191+ }
192+
190193 FbConnectionPoolManager ( )
191194 {
192195 _disposed = 0 ;
You can’t perform that action at this time.
0 commit comments