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)
77
77
var result = cache . GetOrAdd ( dllName , s => { createdNew = true ; return BuildFbClient ( s ) ; } ) ;
78
78
if ( createdNew )
79
79
{
80
- ShutdownHelper . RegisterFbClientShutdown ( ( ) => result . fb_shutdown ( 0 , 0 ) ) ;
80
+ ShutdownHelper . RegisterFbClientShutdown ( ( ) => ShutdownEntryPointWrapper ( result ) ) ;
81
81
}
82
82
return result ;
83
83
}
@@ -305,5 +305,22 @@ private static string SanitizeBaseName(string baseName)
305
305
306
306
return "FB_" + Math . Abs ( baseName . GetHashCode ( ) ) ;
307
307
}
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
+ }
308
325
}
309
326
}
You can’t perform that action at this time.
0 commit comments