Most motor drivers feature a "brake" function, which more or less effectively shorts the motor terminals.Post a link to your motor driver. If you don't have one, Pololu has the best selection.
I am using the vnh5019 https://www.pololu.com/product/1451 and a TB9051FTG https://www.pololu.com/product/2997. Both have a brake function, but it is only working when the motor is moving. But not when the motor is at rest. I dont understand the reason behind this. But it seems its is the way a lot of drivers work.So I just want to understand why. And if there is a work around this, like a circuit which shortens both leads whenever the motor is not used.Thanks