Skip to content

drawing_pf.py exits the whole process from the visualization layer #1

@httpsVishu

Description

@httpsVishu

hey, i was exploring the visualization flow in drawing_pf.py and noticed that the drawing window directly terminates the full Python process when the window is closed

if event.type == pygame.QUIT:
    pygame.quit()
    sys.exit()

the same also happens when pressing q

if keys[pygame.K_q]:
    pygame.quit()
    sys.exit()

and since Game.run() is part of the particle filter demo runtime, the drawing layer should ideally only stop its own loop and let the main program decide how to shut down, calling sys.exit() here makes the visualizer control the lifecycle of the whole application

i feel this can become problematic if the particle filter loop, cleanup logic, logging or any future threaded execution is running alongside the ui because closing the Pygame window immediately raises SystemExit instead of returning cleanly

would this be considered intentional for the demo or an oversight in the visualizer lifecycle?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions