mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Prevent duplicate "finish" threading messages
As they don't get processed and may show up as a memory leak.
This commit is contained in:
parent
3742e5601c
commit
9e07b8a9f1
2 changed files with 4 additions and 1 deletions
|
@ -176,6 +176,7 @@ MsgThread::MsgThread() : BasicThread(), queue_in(this, 0), queue_out(0, this)
|
|||
cnt_sent_in = cnt_sent_out = 0;
|
||||
main_finished = false;
|
||||
child_finished = false;
|
||||
child_sent_finish = false;
|
||||
failed = false;
|
||||
thread_mgr->AddMsgThread(this);
|
||||
}
|
||||
|
@ -185,9 +186,10 @@ extern int signal_val;
|
|||
|
||||
void MsgThread::OnSignalStop()
|
||||
{
|
||||
if ( main_finished || Killed() )
|
||||
if ( main_finished || Killed() || child_sent_finish )
|
||||
return;
|
||||
|
||||
child_sent_finish = true;
|
||||
// Signal thread to terminate.
|
||||
SendIn(new FinishMessage(this, network_time), true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue