diff options
Diffstat (limited to 'src/msg_manager.cpp')
-rwxr-xr-x | src/msg_manager.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/msg_manager.cpp b/src/msg_manager.cpp index 9f41d08c..5fe44771 100755 --- a/src/msg_manager.cpp +++ b/src/msg_manager.cpp @@ -51,15 +51,20 @@ bool CMessagingManager::Create(uint8_t num_dp_threads,std::string a_name){ return (true); } void CMessagingManager::Delete(){ - if (m_dp_to_cp) { - m_dp_to_cp->Delete(); - delete []m_dp_to_cp; - } - if (m_cp_to_dp) { - m_cp_to_dp->Delete(); - delete []m_cp_to_dp; + + assert(m_cp_to_dp); + assert(m_dp_to_cp); + int i; + for (i=0; i<m_num_dp_threads; i++) { + CNodeRing * lp; + lp=getRingCpToDp(i); + lp->Delete(); + lp=getRingDpToCp(i); + lp->Delete(); } + delete []m_dp_to_cp; + delete []m_cp_to_dp; } CNodeRing * CMessagingManager::getRingCpToDp(uint8_t thread_id){ @@ -76,6 +81,7 @@ CNodeRing * CMessagingManager::getRingDpToCp(uint8_t thread_id){ void CMsgIns::Free(){ if (m_ins) { + m_ins->Delete(); delete m_ins; } } @@ -98,6 +104,12 @@ bool CMsgIns::Create(uint8_t num_threads){ } +void CMsgIns::Delete(){ + m_cp_dp.Delete(); + m_rx_dp.Delete(); +} + + CMsgIns * CMsgIns::m_ins=0; |