fix objectdb leaks on exit

This commit is contained in:
Matt Parker
2025-10-01 00:44:45 +10:00
parent ee06bd8497
commit 854b14ba24
5 changed files with 21 additions and 13 deletions

View File

@@ -4,12 +4,17 @@ using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
namespace SharpIDE.Godot.Features.Problems;
public partial class DiagnosticMetadataContainer(Diagnostic diagnostic) : GodotObject
// public partial class GenericContainer<T>(T item) : RefCounted
// {
// public T Item { get; } = item;
// }
public partial class DiagnosticMetadataContainer(Diagnostic diagnostic) : RefCounted
{
public Diagnostic Diagnostic { get; } = diagnostic;
}
public partial class ProjectContainer(SharpIdeProjectModel project) : GodotObject
public partial class ProjectContainer(SharpIdeProjectModel project) : RefCounted
{
public SharpIdeProjectModel Project { get; } = project;
}

View File

@@ -35,7 +35,7 @@ public partial class ProblemsPanel : Control
.Subscribe(s =>
{
GD.Print($"ProblemsPanel: Solution changed to {s?.Name ?? "null"}");
_projects.Clear();
_projects.RemoveRange(_projects);
_projects.AddRange(s!.AllProjects);
}).AddTo(this);
BindToTree(_projects);