mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
memory management fixes for loggers
This commit is contained in:
parent
41aee03c17
commit
fbe33d4ee9
3 changed files with 15 additions and 16 deletions
|
@ -193,9 +193,9 @@ zeek::detail::trigger::Manager* zeek::detail::trigger_mgr = nullptr;
|
|||
std::vector<std::string> zeek::detail::zeek_script_prefixes;
|
||||
zeek::detail::Stmt* zeek::detail::stmts = nullptr;
|
||||
zeek::EventRegistry* zeek::event_registry = nullptr;
|
||||
zeek::detail::ProfileLogger* zeek::detail::profiling_logger = nullptr;
|
||||
zeek::detail::ProfileLogger* zeek::detail::segment_logger = nullptr;
|
||||
zeek::detail::SampleLogger* zeek::detail::sample_logger = nullptr;
|
||||
std::shared_ptr<zeek::detail::ProfileLogger> zeek::detail::profiling_logger;
|
||||
std::shared_ptr<zeek::detail::ProfileLogger> zeek::detail::segment_logger;
|
||||
std::shared_ptr<zeek::detail::SampleLogger> zeek::detail::sample_logger;
|
||||
|
||||
zeek::detail::FragmentManager* zeek::detail::fragment_mgr = nullptr;
|
||||
|
||||
|
@ -403,8 +403,6 @@ static void terminate_zeek()
|
|||
// allocation code when killing Zeek. Disabling this for now.
|
||||
if ( ! (signal_val == SIGTERM || signal_val == SIGINT) )
|
||||
profiling_logger->Log();
|
||||
|
||||
delete profiling_logger;
|
||||
}
|
||||
|
||||
event_mgr.Drain();
|
||||
|
@ -976,7 +974,8 @@ SetupResult setup(int argc, char** argv, Options* zopts)
|
|||
if ( profiling_interval > 0 )
|
||||
{
|
||||
const auto& profiling_file = id::find_val("profiling_file");
|
||||
profiling_logger = new ProfileLogger(profiling_file->AsFile(), profiling_interval);
|
||||
profiling_logger = std::make_shared<ProfileLogger>(profiling_file->AsFile(),
|
||||
profiling_interval);
|
||||
|
||||
if ( segment_profiling )
|
||||
segment_logger = profiling_logger;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue