Skip to content

Commit

Permalink
Exit Dispose early if reader is already disposed
Browse files Browse the repository at this point in the history
Otherwise calling Close followed by Dispose generates an exception
internally, bad for perf and for the debugging experience.

Fixes #18307
  • Loading branch information
roji committed Oct 25, 2019
1 parent 680b887 commit 6148e6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Microsoft.Data.Sqlite.Core/SqliteDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public override void Close()
/// </param>
protected override void Dispose(bool disposing)
{
if (!disposing)
if (!disposing || _closed)
{
return;
}
Expand Down

0 comments on commit 6148e6b

Please sign in to comment.