smithay
smithay copied to clipboard
`GlesRenderer` with shared `EGLContext` may leak resources when they are not dropped before the renderer
GlesRenderer relies on a destruction_callback: Receiver<CleanupResource> to cleanup GL resources whose references have been Droped.
But with shared contexts, it's presumably possible for this to result in leaking resources, when a GlesRenderer is destroyed before some objects created by it, and other GlesRenderers using the shared context still exist. The Receiver will be gone, and nothing will cleanup these things, but their handles are still valid on the shared contexts.
@Drakulix and I concluded that shared contexts should probably share the list of things to be destroyed, perhaps in an EGLContext user data.