Clear sessions when session manager is done

It looks like there is no reason to keep sessions in the map beyond the
point where the session manager is considered done. This hopefully
simplifies the shutdown control flow a tiny bit.
This commit is contained in:
Jan Grashoefer 2025-04-15 13:29:01 +02:00
parent 3b478ddc0a
commit 013dc2010f
3 changed files with 3 additions and 7 deletions

View file

@ -88,7 +88,7 @@ void fuzzer_cleanup_one_input() {
zeek::event_mgr.Drain(); zeek::event_mgr.Drain();
zeek::session_mgr->Drain(); zeek::session_mgr->Drain();
zeek::event_mgr.Drain(); zeek::event_mgr.Drain();
zeek::session_mgr->Clear(); zeek::session_mgr->Done();
run_state::terminating = false; run_state::terminating = false;
} }

View file

@ -82,12 +82,9 @@ Manager::Manager() {
}); });
} }
Manager::~Manager() { Manager::~Manager() { delete stats; }
Clear();
delete stats;
}
void Manager::Done() {} void Manager::Done() { Clear(); }
Connection* Manager::FindConnection(Val* v) { Connection* Manager::FindConnection(Val* v) {
zeek::detail::ConnKey conn_key(v); zeek::detail::ConnKey conn_key(v);

View file

@ -391,7 +391,6 @@ static void terminate_zeek() {
event_mgr.Drain(); event_mgr.Drain();
session_mgr->Clear();
plugin_mgr->FinishPlugins(); plugin_mgr->FinishPlugins();
finish_script_execution(); finish_script_execution();