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

Pen memory leak at shutdown #12099

Open
slouken opened this issue Jan 27, 2025 · 2 comments
Open

Pen memory leak at shutdown #12099

slouken opened this issue Jan 27, 2025 · 2 comments
Assignees
Milestone

Comments

@slouken
Copy link
Collaborator

slouken commented Jan 27, 2025

I haven't checked the other backends, but the X11 backend leaks pen handles.

SDL_QuitPen() gets called before X11_QuitPen(), so there aren't any pens left to clean up and the X11 handles are leaked.

I'm not sure the best way to handle this. Maybe add a cleanup callback to the AddPen call? Why don't we run into this with other types of devices?

@slouken slouken added this to the 3.2.2 milestone Jan 27, 2025
@icculus
Copy link
Collaborator

icculus commented Jan 29, 2025

We probably just need to move the SDL_QuitPen() call in SDL_VideoQuit() down below the call to _this->VideoQuit(_this); so the backends get first shot at cleaning up system handles.

@slouken
Copy link
Collaborator Author

slouken commented Jan 29, 2025

Should we do that for all the SDL_Quit*?

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

No branches or pull requests

2 participants