mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
Scope: unref all inits in destructor
Fixes memory leak. Proof that the Scope class is responsible for freeing those objects can be found infunction_ingredients::~function_ingredients().
This commit is contained in:
parent
2c0ece7376
commit
8ea1d89529
1 changed files with 7 additions and 1 deletions
|
@ -56,7 +56,13 @@ Scope::~Scope()
|
||||||
|
|
||||||
Unref(scope_id);
|
Unref(scope_id);
|
||||||
Unref(return_type);
|
Unref(return_type);
|
||||||
delete inits;
|
|
||||||
|
if ( inits )
|
||||||
|
{
|
||||||
|
for ( const auto& i : *inits )
|
||||||
|
Unref(i);
|
||||||
|
delete inits;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ID* Scope::GenerateTemporary(const char* name)
|
ID* Scope::GenerateTemporary(const char* name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue