Skip to content

Conversation

@Quant1um
Copy link
Contributor

@Quant1um Quant1um commented Jul 21, 2025

This PR fixes a memory leak caused by not releasing the GL context on X11 by calling glXDestroyContext, and fixes a BadDrawable error when closing the window in the middle of drawing by synchronizing a call to WindowHandle::close() with the event loop via channels.

Should fix #142

@micahrj
Copy link
Member

micahrj commented Nov 12, 2025

I don't think the synchronization is sufficient here. The SyncSender will only block until the message is received, but we actually need WindowHandle::close to block until the process of closing the window is complete. I would recommend implementing this by storing the JoinHandle for the event loop thread in WindowHandle and joining it in WindowHandle::close.

If you don't mind, I think it would be ideal to move the window close synchronization code into a separate PR, since it's a more complex change and will probably need to go through some iteration. That way the change to add the glXDestroyContext call can get approved and merged right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic in Reaper on Linux when closing plugin window

2 participants