Fix two destruction order issues causing segfaults during shutdown#789
Open
hefroy wants to merge 1 commit intoCOVESA:masterfrom
Open
Fix two destruction order issues causing segfaults during shutdown#789hefroy wants to merge 1 commit intoCOVESA:masterfrom
hefroy wants to merge 1 commit intoCOVESA:masterfrom
Conversation
1. `application_impl::~application_impl` calls the `plugin_manager` when `VSOMEIP_ENABLE_MULTIPLE_ROUTING_MANAGERS` is not defined. Therefore it should hold a `shared_ptr` to it instead of calling `plugin_manager::get()` in the destructor, in order to prevent the global `the_plugin_manager__` instance being destroyed before it is. 2. `routing_manager_impl::~routing_manager_impl` calls `utility` functions. Therefore destroy the `routing_` instance in `application_impl::shutdown` to ensure that this happens before the `utility` global variables are destroyed.
Contributor
Author
|
For reference, this patch is being used over in https://github.com/aws/aws-iot-fleetwise-edge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.