Skip to content

Conversation

oddbookworm
Copy link
Contributor

fixes #3679

I'm pretty sure that I got most of them, but I probably missed a few

@Starbuck5
Copy link
Contributor

So I’ve been thinking about this as Matt has brought it up. Pygame.display.quit turns the screen SDL_surface into NULL— but should it? Is there any (current) reason the screen surface can’t continue in software after the display behind it has quit? Why try and error on everything a surface could do, what if we could instead error on pygame.event.get or pygame.display.flip.

@MightyJosip
Copy link
Contributor

You can probably include stuff from #3525 in your PR. There is also this comment that may be relevant #3525 (comment)

@oddbookworm
Copy link
Contributor Author

So I’ve been thinking about this as Matt has brought it up. Pygame.display.quit turns the screen SDL_surface into NULL— but should it? Is there any (current) reason the screen surface can’t continue in software after the display behind it has quit? Why try and error on everything a surface could do, what if we could instead error on pygame.event.get or pygame.display.flip.

This is fair, but I still think that my PR is still relevant. If someone somehow still would end up with a weird, broken surface it would still potentially segfault

@oddbookworm
Copy link
Contributor Author

You can probably include stuff from #3525 in your PR. There is also this comment that may be relevant #3525 (comment)

Are you suggesting that the two PR's should be effectively merged into one? Since the same code is repeated in different places in both, I think that would be a good idea. I also like the idea of a macro. Maybe SURF_INIT_CHECK instead of VIDEO_INIT_CHECK like @Starbuck5 suggested in your PR?

Maybe something like this?

#define SURF_INIT_CHECK(SDL_SurfObj) if (!SDL_SurfObj) {return RAISE(pgExc_SDL_Error, "Surface is not initialized");}

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.

Segfault when trying to draw to screen after calling pygame.quit
3 participants