Skip to content
Open
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
14 changes: 14 additions & 0 deletions osu.Framework.Tests/Visual/Drawables/TestSceneDrawablePool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,20 @@ public void TestDrawablePreparedWhenClockRewound()
AddAssert("child prepared", () => drawable.PreparedCount == 1);
}

[Test]
public void TestUsePoolableDrawableWithProxy()
{
const int pool_size = 1;

resetWithNewPool(() => new TestPool(TimePerAction, pool_size));

AddRepeatStep("get new pooled drawable with proxy", () =>
{
var drawable = consumeDrawable();
Add(drawable.CreateProxy());
}, 50);
}

protected override void Update()
{
base.Update();
Expand Down
6 changes: 6 additions & 0 deletions osu.Framework/Graphics/Drawable_ProxyDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ internal override DrawNode GenerateDrawNodeSubtree(ulong frame, int treeIndex, b

public override bool UpdateSubTreeMasking() => true;

protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
Original.proxy = null;
}

private class ProxyDrawNode : DrawNode
{
/// <summary>
Expand Down
Loading