vsomeip
vsomeip copied to clipboard
Fix two destruction order issues causing segfaults during shutdown
application_impl::~application_implcalls theplugin_managerwhenVSOMEIP_ENABLE_MULTIPLE_ROUTING_MANAGERSis not defined. Therefore it should hold ashared_ptrto it instead of callingplugin_manager::get()in the destructor, in order to prevent the globalthe_plugin_manager__instance being destroyed before it is.routing_manager_impl::~routing_manager_implcallsutilityfunctions. Therefore destroy therouting_instance inapplication_impl::shutdownto ensure that this happens before theutilityglobal variables are destroyed.
For reference, this patch is being used over in https://github.com/aws/aws-iot-fleetwise-edge See the patch file here: https://github.com/aws/aws-iot-fleetwise-edge/blob/a6bfb5176eb0a954b436473802de3221b815be7e/tools/patches/vsomeip_allow_static_libs_fix_shutdown_segfaults.patch