From 1c2527eca365f3a65ca6a59a456f387c54c4e27f Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 24 Oct 2019 15:15:47 +0200 Subject: [PATCH] Exit Dispose early if reader is already disposed Otherwise calling Close followed by Dispose generates an exception internally, bad for perf and for the debugging experience. Fixes #18307 --- src/Microsoft.Data.Sqlite.Core/SqliteDataReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Data.Sqlite.Core/SqliteDataReader.cs b/src/Microsoft.Data.Sqlite.Core/SqliteDataReader.cs index ba4ebd90476..62c7e40c5e4 100644 --- a/src/Microsoft.Data.Sqlite.Core/SqliteDataReader.cs +++ b/src/Microsoft.Data.Sqlite.Core/SqliteDataReader.cs @@ -227,7 +227,7 @@ public override void Close() /// protected override void Dispose(bool disposing) { - if (!disposing) + if (!disposing || _closed) { return; }