File tree Expand file tree Collapse file tree 1 file changed +6
-16
lines changed
src/Components/Components/src Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,7 @@ protected IServiceProvider ScopedServices
4444 }
4545 }
4646
47- /// <summary>
48- /// Releases the service scope used by the component.
49- /// </summary>
47+ /// <inhertidoc />
5048 void IDisposable . Dispose ( )
5149 {
5250 Dispose ( disposing : true ) ;
@@ -61,25 +59,17 @@ protected virtual void Dispose(bool disposing)
6159 {
6260 if ( ! IsDisposed )
6361 {
64- if ( disposing )
62+ if ( disposing && _scope . HasValue && _scope . Value is IDisposable disposable )
6563 {
66- if ( _scope . HasValue )
67- {
68- if ( _scope . Value is IDisposable disposable )
69- {
70- disposable . Dispose ( ) ;
71- }
72- _scope = null ;
73- }
64+ disposable . Dispose ( ) ;
65+ _scope = null ;
7466 }
67+
7568 IsDisposed = true ;
7669 }
7770 }
7871
79- /// <summary>
80- /// Asynchronously releases the service scope used by the component.
81- /// </summary>
82- /// <returns>A task that represents the asynchronous dispose operation.</returns>
72+ /// <inhertidoc />
8373 async ValueTask IAsyncDisposable . DisposeAsync ( )
8474 {
8575 await DisposeAsyncCore ( ) . ConfigureAwait ( false ) ;
You can’t perform that action at this time.
0 commit comments