Skip to content

Commit 4a8d5bd

Browse files
committed
Add disposeConnection
1 parent 809411e commit 4a8d5bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dotnet/src/webdriver/BiDi/BiDi.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public class BiDi : IAsyncDisposable
3838
private readonly Lazy<Modules.Log.LogModule> _logModule;
3939
private readonly Lazy<Modules.Storage.StorageModule> _storageModule;
4040

41-
private BiDi(BiDiConnection connection) : this()
41+
private BiDi(BiDiConnection connection, bool disposeConnection) : this()
4242
{
43-
_ownsConnection = false;
43+
_ownsConnection = disposeConnection;
4444
BiDiConnection = connection;
4545
AddBiDiModuleJsonInfo(connection);
4646
}
@@ -103,9 +103,9 @@ public static async Task<BiDi> ConnectAsync(string url)
103103
return bidi;
104104
}
105105

106-
public static ValueTask<BiDi> AttachAsync(BiDiConnection connection)
106+
public static ValueTask<BiDi> AttachAsync(BiDiConnection connection, bool disposeConnection = false)
107107
{
108-
var bidi = new BiDi(connection);
108+
var bidi = new BiDi(connection, disposeConnection);
109109

110110
return new ValueTask<BiDi>(bidi);
111111
}

0 commit comments

Comments
 (0)