From 6f8fc51d6f9424cc1de81f3ae0ba91bc148c24b2 Mon Sep 17 00:00:00 2001 From: Connor Quagliana Date: Wed, 15 Feb 2017 16:25:59 -0800 Subject: [PATCH] Add comment explaining ObjectDisposedException --- .../Connection/ConnectionService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs b/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs index a47f8460..86050aed 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs @@ -328,7 +328,10 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection } catch (ObjectDisposedException) { - // Ignore + // If ObjectDisposedException was thrown, then execution has already exited the + // "using" statment and source was disposed, meaning that the openTask completed + // successfully. This results in a ObjectDisposedException when trying to access + // source.Token and should be ignored. } });