Clarify component disposal async+sync (#25223)
parent
33e97da4e7
commit
a2cc68cc31
|
@ -218,6 +218,10 @@ Although the content in this section focuses on Blazor Server and stateful Signa
|
|||
|
||||
If a component implements <xref:System.IDisposable>, <xref:System.IAsyncDisposable>, or both, the framework calls for unmanaged resource disposal when the component is removed from the UI. Disposal can occur at any time, including during [component initialization](#component-initialization-oninitializedasync).
|
||||
|
||||
Components shouldn't need to implement <xref:System.IDisposable> and <xref:System.IAsyncDisposable> simultaneously. If both are implemented, the framework only executes the asynchronous overload.
|
||||
|
||||
Developer code must ensure that <xref:System.IAsyncDisposable> implementations don't take a long time to complete.
|
||||
|
||||
### Synchronous `IDisposable`
|
||||
|
||||
For synchronous disposal tasks, use <xref:System.IDisposable.Dispose%2A?displayProperty=nameWithType>.
|
||||
|
@ -662,6 +666,10 @@ Although the content in this section focuses on Blazor Server and stateful Signa
|
|||
|
||||
If a component implements <xref:System.IDisposable>, <xref:System.IAsyncDisposable>, or both, the framework calls for unmanaged resource disposal when the component is removed from the UI. Disposal can occur at any time, including during [component initialization](#component-initialization-oninitializedasync).
|
||||
|
||||
Components shouldn't need to implement <xref:System.IDisposable> and <xref:System.IAsyncDisposable> simultaneously. If both are implemented, the framework only executes the asynchronous overload.
|
||||
|
||||
Developer code must ensure that <xref:System.IAsyncDisposable> implementations don't take a long time to complete.
|
||||
|
||||
### Synchronous `IDisposable`
|
||||
|
||||
For synchronous disposal tasks, use <xref:System.IDisposable.Dispose%2A?displayProperty=nameWithType>.
|
||||
|
@ -1102,6 +1110,10 @@ Although the content in this section focuses on Blazor Server and stateful Signa
|
|||
|
||||
If a component implements <xref:System.IDisposable>, <xref:System.IAsyncDisposable>, or both, the framework calls for unmanaged resource disposal when the component is removed from the UI. Disposal can occur at any time, including during [component initialization](#component-initialization-oninitializedasync).
|
||||
|
||||
Components shouldn't need to implement <xref:System.IDisposable> and <xref:System.IAsyncDisposable> simultaneously. If both are implemented, the framework only executes the asynchronous overload.
|
||||
|
||||
Developer code must ensure that <xref:System.IAsyncDisposable> implementations don't take a long time to complete.
|
||||
|
||||
### Synchronous `IDisposable`
|
||||
|
||||
For synchronous disposal tasks, use <xref:System.IDisposable.Dispose%2A?displayProperty=nameWithType>.
|
||||
|
|
Loading…
Reference in New Issue