diff options
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(); + } } |