laxnpander / OpenREALM

OpenREALM is a pipeline for real-time aerial mapping utilizing visual SLAM and 3D reconstruction frameworks.
GNU Lesser General Public License v2.1
453 stars 117 forks source link

Bugfix :: OpenVSlam Crash if close() called twice #54

Closed zthorson closed 3 years ago

zthorson commented 3 years ago

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

zthorson commented 3 years ago

Any changes needed to merge this?

laxnpander commented 3 years ago

@zthorson: Nope, looks fine! I will try to merge all PR's within next week. Currently very busy with work.