Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Components/Components/src/RenderTree/Renderer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable disable warnings
Expand Down Expand Up @@ -959,6 +959,11 @@ private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? er
protected virtual void Dispose(bool disposing)
{
Disposed = true;

if (TestableMetadataUpdate.IsSupported)
{
HotReloadManager.OnDeltaApplied -= RenderRootComponentsOnHotReload;
}

// It's important that we handle all exceptions here before reporting any of them.
// This way we can dispose all components before an error handler kicks in.
Expand Down Expand Up @@ -1058,11 +1063,6 @@ public void Dispose()
/// <inheritdoc />
public async ValueTask DisposeAsync()
{
if (TestableMetadataUpdate.IsSupported)
{
HotReloadManager.OnDeltaApplied -= RenderRootComponentsOnHotReload;
}

if (Disposed)
{
return;
Expand Down
Loading