Not having this line creates a memory leak of one CallFrame per script invocation.This change sometimes triggers an EmptyStackException which didn't exist before.
I added a guard, since I'm still not sure why the EmptyStackException was happening.
More importantly, it looks like there's also a leak tied to each invocation of a built-in function. Apparently LibraryFunction invocations bypass FunctionReturn entirely; we probably shouldn't be spreading the stack tracking across both those classes anyways.
Both of those leaks should be resolved by the attached patch.
Attachments
Last edited: