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:
Max Kellermann 2020-02-26 05:39:01 +01:00
parent 2c0ece7376
commit 8ea1d89529

View file

@ -56,7 +56,13 @@ Scope::~Scope()
Unref(scope_id);
Unref(return_type);
delete inits;
if ( inits )
{
for ( const auto& i : *inits )
Unref(i);
delete inits;
}
}
ID* Scope::GenerateTemporary(const char* name)