File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Provider/src/FirebirdSql.Data.FirebirdClient/Client/Native Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public static IFbClient Create(string dllName)
7777 var result = cache . GetOrAdd ( dllName , s => { createdNew = true ; return BuildFbClient ( s ) ; } ) ;
7878 if ( createdNew )
7979 {
80- ShutdownHelper . RegisterFbClientShutdown ( ( ) => result . fb_shutdown ( 0 , 0 ) ) ;
80+ ShutdownHelper . RegisterFbClientShutdown ( ( ) => ShutdownEntryPointWrapper ( result ) ) ;
8181 }
8282 return result ;
8383 }
@@ -305,5 +305,22 @@ private static string SanitizeBaseName(string baseName)
305305
306306 return "FB_" + Math . Abs ( baseName . GetHashCode ( ) ) ;
307307 }
308+
309+ private static void ShutdownEntryPointWrapper ( IFbClient fbClient )
310+ {
311+ // the fb_shutdown does not exists before 2.5
312+ // the exception is just ignored
313+ // once <2.5 is not existing we can remove this
314+ try
315+ {
316+ fbClient . fb_shutdown ( 0 , 0 ) ;
317+ }
318+ #if NETSTANDARD1_6
319+ catch ( Exception ex ) when ( ex . GetType ( ) . Name == "EntryPointNotFoundException" )
320+ #else
321+ catch ( EntryPointNotFoundException )
322+ #endif
323+ { }
324+ }
308325 }
309326}
You can’t perform that action at this time.
0 commit comments