mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
change Trigger constructor to not potentially auto-delete itself
This commit is contained in:
parent
8c2a9ec5f5
commit
e8f4e54475
6 changed files with 49 additions and 21 deletions
|
@ -438,14 +438,10 @@ void CPPCompile::GenWhenStmt(const WhenStmt* w)
|
|||
Emit("new_frame->SetTrigger({NewRef{}, curr_t});");
|
||||
Emit("new_frame->SetTriggerAssoc(curr_assoc);");
|
||||
|
||||
Emit("auto t = new trigger::Trigger(CPP__wi, %s, CPP__w_globals, CPP__local_aggrs, "
|
||||
"new_frame.get(), "
|
||||
"nullptr);",
|
||||
Emit("auto t = make_intrusive<trigger::Trigger>(CPP__wi, CPP__w_globals, CPP__local_aggrs, %s, "
|
||||
"new_frame.get());",
|
||||
timeout_val);
|
||||
|
||||
auto loc_str = util::fmt("%s:%d-%d", loc->filename, loc->first_line, loc->last_line);
|
||||
Emit("t->SetName(\"%s\");", loc_str);
|
||||
|
||||
if ( ret_type && ret_type->Tag() != TYPE_VOID )
|
||||
{
|
||||
// Note, ret_type can be active but we *still* don't have
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue