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

Bugfix orphaned handlers on shot groups #1622

Merged
merged 2 commits into from
Dec 29, 2021

Conversation

avanwinkle
Copy link
Collaborator

This PR fixes a bug created in 58d3df6 that causes shot groups to continually add event handlers.

The change in 58d3df6 introduces new handlers for the ShotGroup's self._check_for_complete when the device is added to a mode, but these handlers are never removed. The next time the mode starts, they are all added again.

This PR removes these handlers in the ShotGroup's self.device_removed_from_mode() method, and adds a test to prevent regression.

Also, this PR adds a catch during shutdown. During a catastrophic failure, e.g. a syntax error in an MPF file that prevents startup, self.events is undefined and that subsequent error blocks the stacktrace of the underlying syntax error. This catch allows the machine to gracefully shutdown and display a useful stacktrace.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jabdoa2
Copy link
Collaborator

jabdoa2 commented Dec 29, 2021

Thanks! Good one.

@avanwinkle avanwinkle merged commit ca315fa into missionpinball:dev Dec 29, 2021
@avanwinkle avanwinkle deleted the bugfix-shot-group-handlers branch December 29, 2021 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants