Skip to content

Segfault when trying to draw to screen after calling pygame.quit #3679

@Martinus2004

Description

@Martinus2004

Environment:

  • PyGame version (pygame 2.1.3.dev8):
  • Python version (Python 3.10.0)
  • SDL version (SDL 2.0.22)

Current behavior:

If there's a pygame.draw.rect() line in the main game loop and pygame.quit() got called in e.g. "if event.type == pygame.QUIT" without the main loop stopping/breaking, there will be a pretty long segfault message printed to the user. (see screenshot below)

Screenshots

image

Getting the segfault

import pygame

screen = pygame.display.set_mode((500, 500))
pygame.quit()

pygame.draw.rect(screen, "blue", pygame.Rect(0, 0, 1, 1))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions