diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-02-01 17:16:38 +0200 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-02-01 17:16:38 +0200 |
commit | 37ea6af93798ef5e2a877b755ff6dc6cb2cde33a (patch) | |
tree | 038bd751a2b5904125769b5192101aa49ef728a7 /src/bp_sim.cpp | |
parent | 00d74df1d05ce2b47d37574fda8806d71841d3e9 (diff) | |
parent | 11bcf4ca8fed5259e321c535bf90d0442e9b9746 (diff) |
Merge from origin
Diffstat (limited to 'src/bp_sim.cpp')
-rwxr-xr-x | src/bp_sim.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index bb1eb073..72ad1097 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -790,13 +790,18 @@ int CErfIF::write_pkt(CCapPktRaw *pkt_raw){ int CErfIF::close_file(void){ - BP_ASSERT(m_raw); - delete m_raw; + if (m_raw) { + delete m_raw; + m_raw = NULL; + } + if ( m_preview_mode->getFileWrite() ){ - BP_ASSERT(m_writer); - delete m_writer; - m_writer=0; + if (m_writer) { + delete m_writer; + m_writer = NULL; + } } + return (0); } @@ -4040,7 +4045,11 @@ void CFlowGenListPerThread::stop_stateless_simulation_file(){ void CFlowGenListPerThread::start_stateless_daemon_simulation(){ m_cur_time_sec = 0; - m_stateless_dp_info.run_once(); + + /* if no pending CP messages - the core will simply be stuck forever */ + if (m_stateless_dp_info.are_any_pending_cp_messages()) { + m_stateless_dp_info.run_once(); + } } |