From 36683406de237140087f360acfcd39284ba91aea Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Wed, 26 Nov 2025 18:10:30 +1000 Subject: [PATCH] unsubscribe event on exittree --- .../CustomMsBuildProjectLoader.cs | 2 +- .../SharpIDE.Application.csproj | 24 +++++++++---------- .../Features/BottomBar/RunningTasksDisplay.cs | 2 ++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/SharpIDE.Application/Features/Analysis/ProjectLoader/CustomMsBuildProjectLoader.cs b/src/SharpIDE.Application/Features/Analysis/ProjectLoader/CustomMsBuildProjectLoader.cs index 03a2629..0b22dc4 100644 --- a/src/SharpIDE.Application/Features/Analysis/ProjectLoader/CustomMsBuildProjectLoader.cs +++ b/src/SharpIDE.Application/Features/Analysis/ProjectLoader/CustomMsBuildProjectLoader.cs @@ -10,7 +10,7 @@ namespace SharpIDE.Application.Features.Analysis.ProjectLoader; // My attempts to provide a custom IAnalyzerService to the MEF composition were in vain. // I think this will only be temporary, as I think a more sophisticated ProjectLoader mechanism is going to be necessary. // see roslyn LanguageServerProjectLoader, LanguageServerProjectSystem, ProjectSystemProjectFactory -// https://github.com/dotnet/roslyn/blob/main/src/Workspaces/MSBuild/Core/MSBuild/MSBuildProjectLoader.cs +// https://github.com/dotnet/roslyn/blob/52d073ff6f1c668e858bed838712467afcf83876/src/Workspaces/MSBuild/Core/MSBuild/MSBuildProjectLoader.cs public partial class CustomMsBuildProjectLoader(Workspace workspace, ImmutableDictionary? properties = null) : MSBuildProjectLoader(workspace, properties) { public async Task<(ImmutableArray, Dictionary)> LoadProjectInfosAsync( diff --git a/src/SharpIDE.Application/SharpIDE.Application.csproj b/src/SharpIDE.Application/SharpIDE.Application.csproj index e8aedde..e6fbbc6 100644 --- a/src/SharpIDE.Application/SharpIDE.Application.csproj +++ b/src/SharpIDE.Application/SharpIDE.Application.csproj @@ -8,18 +8,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/SharpIDE.Godot/Features/BottomBar/RunningTasksDisplay.cs b/src/SharpIDE.Godot/Features/BottomBar/RunningTasksDisplay.cs index f9813a8..dcd4342 100644 --- a/src/SharpIDE.Godot/Features/BottomBar/RunningTasksDisplay.cs +++ b/src/SharpIDE.Godot/Features/BottomBar/RunningTasksDisplay.cs @@ -30,6 +30,8 @@ public partial class RunningTasksDisplay : HBoxContainer public override void _ExitTree() { _activityMonitor.ActivityStarted.Unsubscribe(OnActivityStarted); + _activityMonitor.ActivityStarted.Unsubscribe(OnActivityStopped); + } private async Task OnActivityStarted(Activity activity) => await OnActivityChanged(activity, true);