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

ImGui_ImplAllegro5_UpdateMouseCursor should not create a new cursor each frame #8256

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Helodity
Copy link

Currently, ImGui sends a call to Allegro each time a frame is drawn, either reusing a stored invisible cursor or creating a new system cursor.

Allegro currently has a memory leak in its X11 interface (see this Allegro PR) where system cursors are not cleared when a new one is generated. This paired with creating a new cursor each frame results in a leak that results in an XWayland abort within 10 minutes (see this xorg bug report)

This fix reduces the amount of unnecessary cursor creations by caching which cursor is currently being rendered, and only creating a new one when it changes. This does not fix the memory leak, but heavily mitigates its effect.

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.

1 participant