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

Release shuffleboard data on interpreter exit #152

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions subprojects/robotpy-wpilib/wpilib/simulation/simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ RPYBUILD_PYBIND11_MODULE(m) {
m.def("_resetWpilibSimulationData", &resetWpilibSimulationData,
release_gil());
m.def("_resetMotorSafety", &resetMotorSafety, release_gil());

#ifndef __FRC_ROBORIO__
// ensure that the shuffleboard data is released when python shuts down
static int unused; // the capsule needs something to reference
py::capsule cleanup(&unused, [](void *) {
frc::impl::ResetShuffleboardInstance();
});
m.add_object("_sf_cleanup", cleanup);
#endif
}
Loading