Skip to content

Commit accbfa9

Browse files
ISqlCommand Implementation.Dispose disposes cmd.Connection if it's created in the ctor
1 parent 29e5f22 commit accbfa9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/SqlClient/ISqlCommand.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ type ``ISqlCommand Implementation``(cfg: DesignTimeConfig, connection: Connectio
169169

170170
interface IDisposable with
171171
member this.Dispose() =
172+
if manageConnection then
173+
cmd.Connection.Dispose()
172174
cmd.Dispose()
173175

174176
static member internal SetParameters(cmd: SqlCommand, parameters: (string * obj)[]) =

0 commit comments

Comments
 (0)