mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
ClosureFrame takes ownership of its captured vals.
This commit is contained in:
parent
d468df2a21
commit
b280c62ea5
2 changed files with 4 additions and 3 deletions
|
@ -41,11 +41,13 @@ Frame::Frame(const Frame* other)
|
||||||
this->break_on_return = false;
|
this->break_on_return = false;
|
||||||
this->delayed = false;
|
this->delayed = false;
|
||||||
|
|
||||||
// We need to Ref this because the
|
|
||||||
// destructor will Unref.
|
|
||||||
if ( other->trigger )
|
if ( other->trigger )
|
||||||
Ref(other->trigger);
|
Ref(other->trigger);
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
|
if (frame[i])
|
||||||
|
Ref(frame[i]);
|
||||||
|
|
||||||
this->trigger = other->trigger;
|
this->trigger = other->trigger;
|
||||||
this->call = other->call;
|
this->call = other->call;
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,7 +317,6 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
||||||
return Flavor() == FUNC_FLAVOR_HOOK ? val_mgr->GetTrue() : 0;
|
return Flavor() == FUNC_FLAVOR_HOOK ? val_mgr->GetTrue() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// f will hold the closure & function's values
|
|
||||||
Frame* f = new Frame(frame_size, this, args);
|
Frame* f = new Frame(frame_size, this, args);
|
||||||
if (this->closure)
|
if (this->closure)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue