To avoid memory leaks, dispose the DotNetObjectReference instance created by a component properly and allow proper garbage collection. The DotNetObjectReference instance should be disposed either at component side or JavaScript side.
Use the following patterns to dispose DotNetObjectReference at the component level.
Implement IDisposable interface in the component. Add Dispose method and dispose DotNetObjectReference object inside the Dispose method.
To avoid memory leaks, dispose the DotNetObjectReference instance created by a component properly and allow proper garbage collection. The DotNetObjectReference instance should be disposed either at component side or JavaScript side.
Use the following patterns to dispose DotNetObjectReference at the component level.
Implement IDisposable interface in the component.
Add Dispose method and dispose DotNetObjectReference object inside the Dispose method.
When a component doesn’t dispose of the DotNetObjectReference instance, should be disposed at the JavaScript side as follows.
need an explanation for this answer? contact us directly to get an explanation for this answer