Skip to content

Commit 1080a74

Browse files
committed
Dispose JsonDocument
1 parent f8576e1 commit 1080a74

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetClientWindowsResultConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal class GetClientWindowsResultConverter : JsonConverter<GetClientWindowsR
3131
{
3232
public override GetClientWindowsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3333
{
34-
var doc = JsonDocument.ParseValue(ref reader);
34+
using var doc = JsonDocument.ParseValue(ref reader);
3535
var clientWindows = doc.RootElement.GetProperty("clientWindows").Deserialize<IReadOnlyList<ClientWindowInfo>>(options);
3636

3737
return new GetClientWindowsResult(clientWindows!);

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal class GetCookiesResultConverter : JsonConverter<GetCookiesResult>
3131
{
3232
public override GetCookiesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3333
{
34-
var doc = JsonDocument.ParseValue(ref reader);
34+
using var doc = JsonDocument.ParseValue(ref reader);
3535
var cookies = doc.RootElement.GetProperty("cookies").Deserialize<IReadOnlyList<Modules.Network.Cookie>>(options);
3636
var partitionKey = doc.RootElement.GetProperty("partitionKey").Deserialize<PartitionKey>(options);
3737

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal class GetRealmsResultConverter : JsonConverter<GetRealmsResult>
3131
{
3232
public override GetRealmsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3333
{
34-
var doc = JsonDocument.ParseValue(ref reader);
34+
using var doc = JsonDocument.ParseValue(ref reader);
3535
var realms = doc.RootElement.GetProperty("realms").Deserialize<IReadOnlyList<RealmInfo>>(options);
3636

3737
return new GetRealmsResult(realms!);

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal class GetUserContextsResultConverter : JsonConverter<GetUserContextsRes
3131
{
3232
public override GetUserContextsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3333
{
34-
var doc = JsonDocument.ParseValue(ref reader);
34+
using var doc = JsonDocument.ParseValue(ref reader);
3535
var userContexts = doc.RootElement.GetProperty("userContexts").Deserialize<IReadOnlyList<UserContextInfo>>(options);
3636

3737
return new GetUserContextsResult(userContexts!);

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal class LocateNodesResultConverter : JsonConverter<LocateNodesResult>
3232
{
3333
public override LocateNodesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3434
{
35-
var doc = JsonDocument.ParseValue(ref reader);
35+
using var doc = JsonDocument.ParseValue(ref reader);
3636
var nodes = doc.RootElement.GetProperty("nodes").Deserialize<IReadOnlyList<RemoteValue.Node>>(options);
3737

3838
return new LocateNodesResult(nodes!);

0 commit comments

Comments
 (0)