openvehicles / Open-Vehicle-Monitoring-System-3

Open Vehicle Monitoring System - Version 3
http:///www.openvehicles.com/
Other
593 stars 225 forks source link

Vehicle - Cleaner swap / shutdown of vehicle #1024

Closed frogonwheels closed 3 months ago

frogonwheels commented 3 months ago

I'm not sure whether the m_pending list is just way overkill... but given that it's mostly empty it maybe ok?

Feedback welcome.

dexterbg commented 3 months ago

Sure looks like overkill, but strictly correct: as the vehicle shutdown is now asynchronous, there may be multiple vehicles shutting down (although I wouldn't bet on a stable system in that case).

But I suggest renaming m_pending to a more specific m_pending_shutdown or similar, so reading the code makes it's purpose directly clear.