diff --git a/implementation/runtime/include/application_impl.hpp b/implementation/runtime/include/application_impl.hpp index 082c21471..ec158e216 100644 --- a/implementation/runtime/include/application_impl.hpp +++ b/implementation/runtime/include/application_impl.hpp @@ -34,6 +34,10 @@ #include #include +#ifndef VSOMEIP_ENABLE_MULTIPLE_ROUTING_MANAGERS +#include +#endif + #ifdef ANDROID #include "../../configuration/include/internal_android.hpp" #else @@ -382,6 +386,10 @@ class application_impl: public application, std::string path_; std::shared_ptr configuration_; +#ifndef VSOMEIP_ENABLE_MULTIPLE_ROUTING_MANAGERS + std::shared_ptr plugin_manager_; +#endif + boost::asio::io_context io_; std::set > io_threads_; std::shared_ptr>( io_.get_executor())), @@ -71,7 +74,7 @@ application_impl::~application_impl() { #ifndef VSOMEIP_ENABLE_MULTIPLE_ROUTING_MANAGERS if(configuration_) { - auto its_plugin = plugin_manager::get()->get_plugin( + auto its_plugin = plugin_manager_->get_plugin( plugin_type_e::CONFIGURATION_PLUGIN, VSOMEIP_CFG_LIBRARY); if (its_plugin) { auto its_configuration_plugin @@ -142,7 +145,7 @@ bool application_impl::init() { // TODO: Add loading of custom configuration module } else { // load default module #ifndef VSOMEIP_ENABLE_MULTIPLE_ROUTING_MANAGERS - auto its_plugin = plugin_manager::get()->get_plugin( + auto its_plugin = plugin_manager_->get_plugin( plugin_type_e::CONFIGURATION_PLUGIN, VSOMEIP_CFG_LIBRARY); if (its_plugin) { auto its_configuration_plugin @@ -354,7 +357,7 @@ bool application_impl::init() { auto its_app_plugin_info = its_plugins.find(plugin_type_e::APPLICATION_PLUGIN); if (its_app_plugin_info != its_plugins.end()) { for (auto its_library : its_app_plugin_info->second) { - auto its_application_plugin = plugin_manager::get()->get_plugin( + auto its_application_plugin = plugin_manager_->get_plugin( plugin_type_e::APPLICATION_PLUGIN, its_library); if (its_application_plugin) { VSOMEIP_INFO << "Client 0x" << std::hex << get_client() @@ -486,7 +489,7 @@ void application_impl::start() { auto its_app_plugin_info = its_plugins.find(plugin_type_e::APPLICATION_PLUGIN); if (its_app_plugin_info != its_plugins.end()) { for (const auto& its_library : its_app_plugin_info->second) { - auto its_application_plugin = plugin_manager::get()->get_plugin( + auto its_application_plugin = plugin_manager_->get_plugin( plugin_type_e::APPLICATION_PLUGIN, its_library); if (its_application_plugin) { std::dynamic_pointer_cast(its_application_plugin)-> @@ -562,7 +565,7 @@ void application_impl::stop() { auto its_app_plugin_info = its_plugins.find(plugin_type_e::APPLICATION_PLUGIN); if (its_app_plugin_info != its_plugins.end()) { for (const auto& its_library : its_app_plugin_info->second) { - auto its_application_plugin = plugin_manager::get()->get_plugin( + auto its_application_plugin = plugin_manager_->get_plugin( plugin_type_e::APPLICATION_PLUGIN, its_library); if (its_application_plugin) { std::dynamic_pointer_cast(its_application_plugin)-> @@ -2251,8 +2254,10 @@ void application_impl::shutdown() { } try { - if (routing_) + if (routing_) { routing_->stop(); + routing_.reset(); + } } catch (const std::exception &e) { VSOMEIP_ERROR << "application_impl::" << __func__ << ": stopping routing, " << " catched exception: " << e.what();