mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Remove memory leak in ConditionalCommand (#537)
This also properly handles nullptrs passed into ConditionalCommand instead of having Undefined Behavior or NullPointerExceptions.
This commit is contained in:
committed by
Peter Johnson
parent
4fd4a50d41
commit
d2de94778e
@@ -40,10 +40,9 @@ namespace frc {
|
||||
*/
|
||||
class ConditionalCommand : public Command {
|
||||
public:
|
||||
explicit ConditionalCommand(Command* onTrue,
|
||||
Command* onFalse = new InstantCommand());
|
||||
explicit ConditionalCommand(Command* onTrue, Command* onFalse = nullptr);
|
||||
ConditionalCommand(const std::string& name, Command* onTrue,
|
||||
Command* onFalse = new InstantCommand());
|
||||
Command* onFalse = nullptr);
|
||||
virtual ~ConditionalCommand() = default;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user