mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Close connection explicitly on rename (#2129)
This commit is contained in:
@@ -74,6 +74,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectManagement
|
|||||||
throw new Exception(SR.ObjectNotRenamable(objectUrn));
|
throw new Exception(SR.ObjectNotRenamable(objectUrn));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If connection is not instantiated in the using statement, it can be leaked here, therefore close explicitly.
|
||||||
|
if(serverConnection.SqlConnectionObject.State == System.Data.ConnectionState.Open)
|
||||||
|
{
|
||||||
|
serverConnection.SqlConnectionObject.Close();
|
||||||
|
}
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user