RendererDRMPRIMEGLES: Fix leak of EGL fences #23272
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fix leak of EGL fences
Motivation and context
When running on wayland in a desktop window, kodi will crash with 'Too many open files' after a minute of so of video playback.
I've tracked it down the EGL fences. Render gets called more often than ReleaseBuffer (I'm seeing two Render calls per ReleaseBuffer call).
As we allocate a fence in Render and free in ReleaseBuffer this leaks.
It's safe to call DestroyFence on a non-created fence so use that to stop the leak
How has this been tested?
I've had kodi running on a Pi4 in a wayland window looping video for most of the day
What is the effect on users?
Stops it crashing on video playback
Screenshots (if appropriate):
Types of change
Checklist: