I can’t seem to find any information on how the memory is managed for commands. The documentation instructs you to use commands as follows:
button2->WhenPressed(new Grab()); // In OI.cpp SetDefaultCommand(new DriveWithJoysticksCommand()); // In subsystems
In C++ when you use the new keyword you are manually allocating memory to create that object and therefore must use the delete keyword to deallocate it when finished. My question is does the command scheduler automatically do this? If not how is that memory deallocated to prevent memory leaks from occurring?