summaryrefslogtreecommitdiffstats
path: root/low-can-binding/diagnostic
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-21 13:45:58 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-21 13:45:58 +0100
commit3fe9374a579ce30f5022d81dd2cba30ed408662d (patch)
treeb78231b3a10871d6c263b718c93f84218012f4ef /low-can-binding/diagnostic
parent9cb8f9e5578945b552a6f9b5d3aaaf7794d680d9 (diff)
Code enhancements mem leaks and uninitialized byteeel_4.99.5eel/4.99.54.99.5
Change-Id: I40632b6212118278f5877957a480122e9383e3bc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/diagnostic')
-rw-r--r--low-can-binding/diagnostic/diagnostic-manager.cpp13
-rw-r--r--low-can-binding/diagnostic/diagnostic-manager.hpp1
2 files changed, 14 insertions, 0 deletions
diff --git a/low-can-binding/diagnostic/diagnostic-manager.cpp b/low-can-binding/diagnostic/diagnostic-manager.cpp
index 8533503..0454a7e 100644
--- a/low-can-binding/diagnostic/diagnostic-manager.cpp
+++ b/low-can-binding/diagnostic/diagnostic-manager.cpp
@@ -36,6 +36,19 @@ diagnostic_manager_t::diagnostic_manager_t()
: initialized_{false}
{}
+
+diagnostic_manager_t::~diagnostic_manager_t()
+{
+ for(auto r: recurring_requests_)
+ {
+ delete(r);
+ }
+ for(auto r: non_recurring_requests_)
+ {
+ delete(r);
+ }
+}
+
/// @brief Diagnostic manager isn't initialized at launch but after
/// CAN bus devices initialization. For the moment, it is only possible
/// to have 1 diagnostic bus which are the first bus declared in the JSON
diff --git a/low-can-binding/diagnostic/diagnostic-manager.hpp b/low-can-binding/diagnostic/diagnostic-manager.hpp
index b503a06..1a6ae7e 100644
--- a/low-can-binding/diagnostic/diagnostic-manager.hpp
+++ b/low-can-binding/diagnostic/diagnostic-manager.hpp
@@ -59,6 +59,7 @@ private:
static void shims_timer();
public:
diagnostic_manager_t();
+ ~diagnostic_manager_t();
bool initialize();