Skip to content

Fix rwops and some image stuff on SDL3 #3550

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

Merged
merged 1 commit into from
Aug 17, 2025
Merged

Conversation

ankith26
Copy link
Member

@ankith26 ankith26 commented Aug 4, 2025

  • Fixes image saving return code handling.
  • SDL_INIT_INTERFACE needs to be used on a SDL_IOStreamInterface interface.
  • As a result of the above issue we were going into the error handling path where _pg_rw_close already does PyMem_Free(helper);, resulting in a double free.

With these changes all imageext tests pass and some failing image tests are also passing now.

@ankith26 ankith26 requested a review from a team as a code owner August 4, 2025 07:25
@ankith26 ankith26 force-pushed the ankith26-fix-img-and-rwops branch from 5358547 to eeec672 Compare August 4, 2025 07:36
@MightyJosip
Copy link
Member

Can you do it like this #3515 (without adding new #if SDL_VERSION)

@ankith26
Copy link
Member Author

ankith26 commented Aug 6, 2025

I can do that but I don't see the need for doing it for functions that are used only once.

Copy link
Member

@Starbuck5 Starbuck5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes make sense and my own local testing matches your results on the image and imageext tests.

@Starbuck5 Starbuck5 added image pygame.image sdl3 labels Aug 17, 2025
@ankith26 ankith26 merged commit 11868c4 into main Aug 17, 2025
27 checks passed
@ankith26 ankith26 added this to the 2.5.6 milestone Aug 17, 2025
@ankith26 ankith26 deleted the ankith26-fix-img-and-rwops branch August 17, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
image pygame.image sdl3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants