Skip to content

Commit

Permalink
sc_process: only delete processes within kernel context
Browse files Browse the repository at this point in the history
  • Loading branch information
pah committed May 22, 2018
1 parent c81e0d9 commit f567c9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sysc/kernel/sc_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void sc_process_b::delete_process()

// Immediate deletion:

if ( this != sc_get_current_process_b() )
if ( NULL == sc_get_current_process_b() )
{
delete this;
}
Expand All @@ -182,7 +182,7 @@ void sc_process_b::delete_process()

else
{
m_references_n = 1;
m_references_n = 1;
detach();
simcontext()->mark_to_collect_process( this );
}
Expand Down
1 change: 1 addition & 0 deletions src/sysc/kernel/sc_simcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ sc_simcontext::crunch( bool once )
// by '*m_error'.
out:
this->reset_curr_proc();
do_collect_processes();
if( m_error ) throw *m_error; // re-throw propagated error
}

Expand Down

0 comments on commit f567c9c

Please sign in to comment.