Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate Dispose for ICustomDrawOperation through RenderDataCustomNode. #15224

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

nateglasser
Copy link
Contributor

What does the pull request do?

Implements IDisposable on RenderDataCustomNode to propagate Dispose for ICustomDrawOperation.

What is the current behavior?

Currently the rendering system does not call Dispose for ICustomDrawOperation. This makes it difficult to know when a draw operation can free its resources. The deferred renderer can call Render on an ICustomDrawOperation multiple times, and so a draw operation needs to be told when it is ready to be disposed.

What is the updated/expected behavior with this PR?

ICustomDrawOperation.Dispose will be called when the renderer removes a draw operation from the scene.

How was the solution implemented (if it's not obvious)?

Implements IDisposable for RenderDataCustomNode, which leads to Dispose being propagated up to the ICustomDrawOperation.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #15221
Discussed in #15206

@nateglasser
Copy link
Contributor Author

@dotnet-policy-service agree

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0046932-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 4, 2024
@maxkatz6 maxkatz6 added this pull request to the merge queue Apr 4, 2024
Merged via the queue into AvaloniaUI:master with commit 0853939 Apr 4, 2024
10 checks passed
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch backported-11.1.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICustomDrawOperation object lifetime and ICustomDrawOperation.Dispose
3 participants