Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08f094b

Browse files
authored
Dispose related readers in GroupBySplitQueryingEnumerable (#36484)
Fixes#34280
1 parentf13fcb1 commit08f094b

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

‎src/EFCore.Relational/Query/Internal/GroupBySplitQueryingEnumerable.cs‎

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,19 @@ public void Dispose()
360360
{
361361
_relationalQueryContext.Connection.ReturnCommand(_relationalCommand!);
362362
_dataReader.Dispose();
363+
364+
if(_resultCoordinator!=null)
365+
{
366+
foreach(vardataReaderin_resultCoordinator.DataReaders)
367+
{
368+
dataReader?.DataReader.Dispose();
369+
}
370+
371+
_resultCoordinator.DataReaders.Clear();
372+
373+
_resultCoordinator=null;
374+
}
375+
363376
_dataReader=null;
364377
_dbDataReader=null;
365378
}
@@ -526,20 +539,30 @@ private static async Task<bool> InitializeReaderAsync(AsyncEnumerator enumerator
526539
returnfalse;
527540
}
528541

529-
publicValueTaskDisposeAsync()
542+
publicasyncValueTaskDisposeAsync()
530543
{
531-
if(_dataReaderis notnull)
544+
if(_dataReader!=null)
532545
{
533546
_relationalQueryContext.Connection.ReturnCommand(_relationalCommand!);
547+
await_dataReader.DisposeAsync().ConfigureAwait(false);
548+
549+
if(_resultCoordinator!=null)
550+
{
551+
foreach(vardataReaderin_resultCoordinator.DataReaders)
552+
{
553+
if(dataReader!=null)
554+
{
555+
awaitdataReader.DataReader.DisposeAsync().ConfigureAwait(false);
556+
}
557+
}
558+
559+
_resultCoordinator.DataReaders.Clear();
560+
_resultCoordinator=null;
561+
}
534562

535-
vardataReader=_dataReader;
536563
_dataReader=null;
537564
_dbDataReader=null;
538-
539-
returndataReader.DisposeAsync();
540565
}
541-
542-
returndefault;
543566
}
544567
}
545568
}

‎src/EFCore.Relational/Query/Internal/SplitQueryingEnumerable.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ public void Dispose()
281281
{
282282
_relationalQueryContext.Connection.ReturnCommand(_relationalCommand!);
283283
_dataReader.Dispose();
284+
284285
if(_resultCoordinator!=null)
285286
{
286287
foreach(vardataReaderin_resultCoordinator.DataReaders)
@@ -430,6 +431,7 @@ public async ValueTask DisposeAsync()
430431
{
431432
_relationalQueryContext.Connection.ReturnCommand(_relationalCommand!);
432433
await_dataReader.DisposeAsync().ConfigureAwait(false);
434+
433435
if(_resultCoordinator!=null)
434436
{
435437
foreach(vardataReaderin_resultCoordinator.DataReaders)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp