Skip to content

Commit

Permalink
Make IVirtualGridView implement IDisposable
Browse files Browse the repository at this point in the history
  • Loading branch information
Delsin-Yu committed Oct 14, 2024
1 parent 174f8d0 commit 8615d14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GDViews.VirtualGridView/Core/IVirtualGridView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace GodotViews.VirtualGrid;
/// to navigate through and customise the virtualized grid view.
/// </summary>
/// <typeparam name="TDataType">The type for the data this controller focuses on.</typeparam>
public interface IVirtualGridView<TDataType>
public interface IVirtualGridView<TDataType> : IDisposable
{
/// <summary>
/// Accessor for the currently active ElementPositioner,
Expand Down
6 changes: 6 additions & 0 deletions GDViews.VirtualGridView/Core/VirtualGridViewImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,4 +1183,10 @@ private class DataView
public NullableData<TDataType> Data;
public override string ToString() => $"Button: {AssignedButton?.Name ?? "Null"}, Data: {Data}";
}

/// <inheritdoc/>
public void Dispose()
{
while (_buttonPool.TryPop(out var instance)) instance.QueueFree();
}
}
4 changes: 2 additions & 2 deletions GDViews.VirtualGridView/GDViews.VirtualGridView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<PackageId>GDViews.VirtualGridView</PackageId>
<PackageVersion>0.0.2</PackageVersion>
<PackageVersion>0.0.3</PackageVersion>
<Authors>DE-YU</Authors>
<Description>Based on DotNet, GDViews.VirtualGridView provides classes that are useful for creating highly customizable virtualized grid views.</Description>
<PackageProjectUrl>https://www.nuget.org/packages/GDViews.VirtualGridView</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/Delsin-Yu/GDViews.VirtualGridView</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Godot TabView</PackageTags>
<PackageReleaseNotes>Fix Mouse Wheel Scroll Event doubles, and fix scroll Bar is not accurately reflecting the virtual viewport position.</PackageReleaseNotes>
<PackageReleaseNotes>Make IVirtualGridView implement IDisposable, which allows for cleaning cached button instances that are out of the scene tree.</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>

<IncludeSymbols>true</IncludeSymbols>
Expand Down

0 comments on commit 8615d14

Please sign in to comment.