From 9ecd09263535843e287048d299ca5bdfc85d18d9 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 2 Jun 2017 19:48:24 +0200 Subject: Remove pointer generator that make memory leaks. Only have 1 place where to generate a pointer from a DiagnosticRequest is in low-can-cb.cpp when subscribing. Else now using reference instead of raw pointer. Change-Id: I7fd2f3d30afa90017b945e6b711922036123b6d3 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/binding/application.cpp | 18 ------------------ CAN-binder/low-can-binding/binding/application.hpp | 2 -- 2 files changed, 20 deletions(-) (limited to 'CAN-binder/low-can-binding/binding') diff --git a/CAN-binder/low-can-binding/binding/application.cpp b/CAN-binder/low-can-binding/binding/application.cpp index b916523..6e6353b 100644 --- a/CAN-binder/low-can-binding/binding/application.cpp +++ b/CAN-binder/low-can-binding/binding/application.cpp @@ -76,21 +76,3 @@ void application_t::set_active_message_set(uint8_t id) { active_message_set_ = id; } - - -std::shared_ptr application_t::get_diagnostic_message(const std::string& message_name) const -{ - struct utils::signals_found found; - found = utils::signals_manager_t::instance().find_signals(build_DynamicField(message_name)); - if(! found.diagnostic_messages.empty()) - return found.diagnostic_messages.front(); - return nullptr; -} - -DiagnosticRequest* application_t::get_request_from_diagnostic_message(const std::string& message_name) const -{ - std::shared_ptr diag_msg = get_diagnostic_message(message_name); - if( diag_msg != nullptr && diag_msg->get_supported()) - return new DiagnosticRequest(diag_msg->build_diagnostic_request()); - return nullptr; -} diff --git a/CAN-binder/low-can-binding/binding/application.hpp b/CAN-binder/low-can-binding/binding/application.hpp index 50b2375..5fa6478 100644 --- a/CAN-binder/low-can-binding/binding/application.hpp +++ b/CAN-binder/low-can-binding/binding/application.hpp @@ -78,8 +78,6 @@ class application_t void set_active_message_set(uint8_t id); - std::shared_ptr get_diagnostic_message(const std::string& message_name) const; - DiagnosticRequest* get_request_from_diagnostic_message(const std::string& message_name) const; /* /// TODO: implement this function as method into can_bus class /// @brief Pre initialize actions made before CAN bus initialization -- cgit