Skip to content

Commit 01dc76f

Browse files
committed
Catch IOException in SafeDispose.
There are no known instances of this being thrown, but it seems reasonable to anticipate that it could be thrown from Dispose and can be safely ignored.
1 parent 6b05cd0 commit 01dc76f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ private void ShutdownSocket()
968968

969969
/// <summary>
970970
/// Disposes and sets <paramref name="disposable"/> to <c>null</c>, ignoring any
971-
/// <see cref="SocketException"/> that is thrown.
971+
/// <see cref="IOException"/> or <see cref="SocketException"/> that is thrown.
972972
/// </summary>
973973
/// <typeparam name="T">An <see cref="IDisposable"/> type.</typeparam>
974974
/// <param name="disposable">The object to dispose.</param>
@@ -981,6 +981,9 @@ private static void SafeDispose<T>(ref T disposable)
981981
{
982982
disposable.Dispose();
983983
}
984+
catch (IOException)
985+
{
986+
}
984987
catch (SocketException)
985988
{
986989
}

0 commit comments

Comments
 (0)