-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Fix segmentation fault when destroying window #2530
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure this is the way to proceed on fixing this issue. In general, we allow surface operations even when there is no display surface active. Adding these checks might break existing working code
26a8b4c
to
3ed49bd
Compare
@ankith26 Yeah... I think it's been improved now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Fixes the issue in my testing. You now get a:
Traceback (most recent call last):
File "C:\Users\dan\Programming\scrap\window_destroy_segfault.py", line 15, in <module>
sf.fill((0, 0, 0))
pygame.error: Surface is not initialized
When trying any surface operations on the display surface after destroying the window, which seems fair enough to me.
Fixes: #2523