From 9e215d68dd2556b11dfe2223e2bced58c0a39087 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 28 Jun 2026 11:13:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=20=5Fdispose?= =?UTF-8?q?d=20=E6=A0=87=E8=AE=B0=E9=98=B2=E6=AD=A2=20UI=20=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E8=BF=87=E5=BF=AB=E5=AF=BC=E8=87=B4=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=8F=91=E7=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewV2.razor.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 7168a553..9c9c9c50 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -179,6 +179,7 @@ public partial class DockViewV2 private DockViewOptions? _options = null; private ConcurrentDictionary _componentStates = new(); private string? _layoutConfig; + private bool _disposed; /// /// @@ -215,6 +216,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender); + if (_disposed) + { + return; + } + if (firstRender) { _layoutConfig = LayoutConfig; @@ -232,7 +238,15 @@ protected override async Task OnAfterRenderAsync(bool firstRender) /// /// /// - protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, GetDockViewConfig()); + protected override Task InvokeInitAsync() + { + if (_disposed) + { + return Task.CompletedTask; + } + + return InvokeVoidAsync("init", Id, Interop, GetDockViewConfig()); + } private DockViewConfig GetDockViewConfig() { @@ -494,6 +508,7 @@ protected override ValueTask DisposeAsync(bool disposing) { if (disposing) { + _disposed = true; ThemeProviderService.ThemeChangedAsync -= OnThemeChangedAsync; } From ca32e06c1b5f40de0d660d12b59a5d6069a6f353 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 28 Jun 2026 11:26:48 +0800 Subject: [PATCH 2/2] chore: bump version 10.0.23 --- .../BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj index 183af799..a1f17289 100644 --- a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj +++ b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj @@ -1,7 +1,7 @@  - 10.0.22 + 10.0.23