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

Program causing Mac OS to freeze #4222

Closed
ccowen37 opened this issue May 4, 2024 · 3 comments
Closed

Program causing Mac OS to freeze #4222

ccowen37 opened this issue May 4, 2024 · 3 comments
Labels

Comments

@ccowen37
Copy link

ccowen37 commented May 4, 2024

Hi, I've run into an issue that seems like any Pygame program I try to run causes a freeze and restart on my computer. Any help would be greatly appreciated.

Environment:

  • Operating system : Mac OS Sonoma 14.4.1 (M2, 2022)
  • Python version : 3.12.2
  • SDL 2.28.3
  • PyGame version : 2.5.2

Current behavior:

When I run any Pygame loop computer freezes and restarts.

Steps to reproduce:

Running the code below causes my computer to freeze after about 2s of runtime.

Test code

This codes causes my computer to freeze/restart:

import pygame
import sys

pygame.init()

screen = pygame.display.set_mode([500, 500])

running = True

while running:

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    screen.fill((255, 255, 255))
    pygame.draw.circle(screen, (0, 0, 255), (250, 250), 75)
    pygame.display.flip()

pygame.quit()
sys.exit()
@ccowen37 ccowen37 added the bug label May 4, 2024
@remdal
Copy link

remdal commented May 11, 2024

Hello, why are you using sys? I think you don't need it
so delete "import sys" & "sys.exit()"

@ccowen37
Copy link
Author

The import was just following a tutorial. Deleting it, however, doesn't affect the behavior I'm finding.

@ccowen37
Copy link
Author

The program no longer crashes after updating OS to Sonoma 14.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants