commit | 9c903e063ea8bdb324a421458eed4f51990ccd2c | [log] [tgz] |
---|---|---|
author | Minsheng Zhang <jimmyzms5@gmail.com> | Sat Oct 03 18:16:05 2015 -0500 |
committer | Minsheng Zhang <jimmyzms5@gmail.com> | Sun Oct 04 12:17:43 2015 -0500 |
tree | 16e3c3c277fc4827fcd56e40b1d5bb25c262023f | |
parent | f485d89f163f793671bf3a055e50fab9f0ba27b1 [diff] |
table: fix PriorityFifoPolicy memory leak Change-Id: I1bd7d75b3a24b854a0a07e1fa197ef793f66192f Refs: #3236
diff --git a/daemon/table/cs-policy-priority-fifo.cpp b/daemon/table/cs-policy-priority-fifo.cpp index e7231a9..fa2027b 100644 --- a/daemon/table/cs-policy-priority-fifo.cpp +++ b/daemon/table/cs-policy-priority-fifo.cpp
@@ -38,6 +38,13 @@ { } +PriorityFifoPolicy::~PriorityFifoPolicy() +{ + for (auto entryInfoMapPair : m_entryInfoMap) { + delete entryInfoMapPair.second; + } +} + void PriorityFifoPolicy::doAfterInsert(iterator i) { @@ -134,6 +141,7 @@ m_queues[entryInfo->queueType].erase(entryInfo->queueIt); m_entryInfoMap.erase(i); + delete entryInfo; } void
diff --git a/daemon/table/cs-policy-priority-fifo.hpp b/daemon/table/cs-policy-priority-fifo.hpp index 93ae884..0078c71 100644 --- a/daemon/table/cs-policy-priority-fifo.hpp +++ b/daemon/table/cs-policy-priority-fifo.hpp
@@ -75,6 +75,9 @@ public: PriorityFifoPolicy(); + virtual + ~PriorityFifoPolicy(); + public: static const std::string POLICY_NAME;