Quick answer: Pygame quit() returning but child subprocesses (e.g., audio decoder) staying alive? Pygame doesn't manage external processes - clean them explicitly on quit.

Game spawns ffmpeg for video; pygame.quit() exits the Python process but ffmpeg stays.

Track subprocess handles

List of subprocess.Popen objects. On quit, terminate each.

Or use atexit

Register cleanup in atexit. Runs on Python interpreter shutdown; covers signal exits too.

Use context managers

Subprocess.Popen as a context manager; auto-terminates on exit. Less manual.

“External processes have their own lifecycles. Game shutdown doesn't propagate.”

If your game spawns subprocesses, the lifecycle bookkeeping is mandatory. Surfaces on macOS where orphans waste resources.

Related reading