Completed
Last Updated: 29 Sep 2020 07:40 by ADMIN
Release 2.17.0
William
Created on: 19 Dec 2019 13:03
Category: Window
Type: Bug Report
9
Window throws Cannot process pending renders after the renderer has been disposed when the user closes the page
When you close the page, the Window tries to dispose and this causes an exception that you can see in the Output > ASP.NET Core Server window. The exception does not show up in the browser, but shows up in the logs.


WARN  2019-12-17 09:26:16,300 Unhandled exception rendering component: Cannot process pending renders after the renderer has been disposed.
Object name: 'Renderer'.
System.ObjectDisposedException: Cannot process pending renders after the renderer has been disposed.
Object name: 'Renderer'.
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessPendingRender()
   at Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer.ProcessPendingRender()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContextDispatcher.InvokeAsync(Action workItem)
   at Microsoft.AspNetCore.Components.ComponentBase.InvokeAsync(Action workItem)
   at Telerik.Blazor.Components.TelerikWindowBase.Refresh()
   at Telerik.Blazor.Components.TelerikWindowBase.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.Dispose()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.Dispose(Boolean disposing)

3 comments
ADMIN
Marin Bratanov
Posted on: 29 Sep 2020 07:40

Hi Daniel,

You can Follow this page to see when the source code becomes available. What I can say at this point is that we added defensive checks and manually disposed some resources.

 

Regards,
Marin Bratanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Daniel
Posted on: 29 Sep 2020 07:25

Hi Marin,

may i ask about how you guys solved this issue as this thread is labeled as "completed" and release "2.17.0". I cannot find a clue how to avoid getting that exception in my own components. Also IAsyncDisposable as mentioned in the link you provided is not available yet. So you guys must have found a workaround or something.

So lonG

Daniel

ADMIN
Marin Bratanov
Posted on: 19 Dec 2019 16:42

A quick update to provide some more context:

This exception is shown in the Debug section of the Ouput window in VS, and reloading the app once is enough so a Dispose is triggered. I do not see the exception in the console, however, and it does not break the app.

It may also manifest with other components that use animations and popups (for example, the AnimationContainer).

That said, the deeper issue is that Dispose() does not function perfectly well for cleaning up, but there is no better hook in the framework (at the moment). You can read more about this here: https://github.com/aspnet/AspNetCore/issues/13026. At the moment we simply don't have any hook or way to avoid this, and at least this exception does not break the app. Hopefully, the framework will provide more suitable events in the future.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor