Clean up arguments added to stack after CallDecl engine call (#13469)

# Description

Just realized I hadn't been cleaning up the arguments added to the
`Stack` after the `CallDecl` engine call was finished, so there could be
a bit of a memory leak if a plugin made many calls during the duration
of a single plugin call. This is a quick patch to that.

I'm probably going to revise how this all works at some point soon
because I think it is a bit of a pitfall. It would be good to make it
much more difficult to make a mistake with it, perhaps with a guard like
Ian did for the redirection stuff.

# After Submitting
- [ ] release with 0.96.1
This commit is contained in:
Devyn Cairns 2024-07-27 19:39:17 -07:00 committed by GitHub
parent 5f7afafe51
commit d80de68665
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -257,12 +257,9 @@ impl<'a> PluginExecutionContext for PluginExecutionCommandContext<'a> {
}
}
decl.run(
&self.engine_state,
stack,
&(&call_builder.finish()).into(),
input,
)
call_builder.with(stack, |stack, call| {
decl.run(&self.engine_state, stack, call, input)
})
}
fn boxed(&self) -> Box<dyn PluginExecutionContext + 'static> {