Fixes an issue if close() is called twice on the OpenVSLAM wrapper. While this shouldn't occur if the library is used correctly, it matches the hardening done in the rest of the system against crashes.
Reason
Internally, OpenVSLAM ends up called join() on a thread when it isn't in a joinable state. This throws a standard exception that isn't caught and can crash out the program.
Method / Design
OpenVSLAM itself doesn't expose whether a shutdown has already occurred, so as a workaround we check if we have already tried to terminate the main system. If we have, we do not call shutdown a second time. This is a bit of a rough workaround, but I don't want to put too much more time into modifying OpenVSLAM as we will likely be moving away from it.
Description
Fixes an issue if close() is called twice on the OpenVSLAM wrapper. While this shouldn't occur if the library is used correctly, it matches the hardening done in the rest of the system against crashes.
Reason
Internally, OpenVSLAM ends up called join() on a thread when it isn't in a joinable state. This throws a standard exception that isn't caught and can crash out the program.
Method / Design
OpenVSLAM itself doesn't expose whether a shutdown has already occurred, so as a workaround we check if we have already tried to terminate the main system. If we have, we do not call shutdown a second time. This is a bit of a rough workaround, but I don't want to put too much more time into modifying OpenVSLAM as we will likely be moving away from it.
Testing
Compiled and run on: Ubuntu 20.04 - Desktop
Other Notes