mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fix IterativeRobot/TimedRobot RobotInit(). (#633)
In C++, it's not legal to call a virtual function from within a constructor, so the user override was never called (the base function is always called). See https://isocpp.org/wiki/faq/strange-inheritance#calling-virtuals-from-ctors While this is technically allowed in Java, also change Java for consistency.
This commit is contained in:
@@ -146,13 +146,6 @@ void IterativeRobotBase::TestPeriodic() {
|
||||
}
|
||||
}
|
||||
|
||||
IterativeRobotBase::IterativeRobotBase() {
|
||||
RobotInit();
|
||||
|
||||
// Tell the DS that the robot is ready to be enabled
|
||||
HAL_ObserveUserProgramStarting();
|
||||
}
|
||||
|
||||
void IterativeRobotBase::LoopFunc() {
|
||||
// Call the appropriate function depending upon the current robot mode
|
||||
if (IsDisabled()) {
|
||||
|
||||
Reference in New Issue
Block a user