public bool TryDisposeInBatch(RenderBatchBuilder batchBuilder, out Exception exception) { _componentWasDisposed = true; exception = null; try { if (Component is IDisposable disposable) { disposable.Dispose(); } } catch (Exception ex) { exception = ex; } // We don't expect these things to throw. RenderTreeDiffBuilder.DisposeFrames(batchBuilder, CurrentRenderTree.GetFrames()); if (_hasAnyCascadingParameterSubscriptions) { RemoveCascadingParameterSubscriptions(); } DisposeBuffers(); return(exception == null); }
/// <summary> /// Notifies the component that it is being disposed. /// </summary> public void NotifyDisposed(RenderBatchBuilder batchBuilder) { // TODO: Handle components throwing during dispose. Shouldn't break the whole render batch. if (_component is IDisposable disposable) { disposable.Dispose(); } RenderTreeDiffBuilder.DisposeFrames(batchBuilder, _renderTreeBuilderCurrent.GetFrames()); }
private void CleanupComponentStateResources(RenderBatchBuilder batchBuilder) { // We don't expect these things to throw. RenderTreeDiffBuilder.DisposeFrames(batchBuilder, CurrentRenderTree.GetFrames()); if (_hasAnyCascadingParameterSubscriptions) { RemoveCascadingParameterSubscriptions(); } DisposeBuffers(); }
public void DisposeInBatch(RenderBatchBuilder batchBuilder) { _componentWasDisposed = true; // TODO: Handle components throwing during dispose. Shouldn't break the whole render batch. if (Component is IDisposable disposable) { disposable.Dispose(); } RenderTreeDiffBuilder.DisposeFrames(batchBuilder, CurrrentRenderTree.GetFrames()); if (_hasAnyCascadingParameterSubscriptions) { RemoveCascadingParameterSubscriptions(); } }