fix(frontends/lean): must invoke lua GC before closing a scope, reason: we may still have references to the current environment inside of the Lua state object
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
9d6bd7501c
commit
771b099c0c
1 changed files with 1 additions and 0 deletions
|
@ -733,6 +733,7 @@ void parser_imp::parse_end() {
|
||||||
throw parser_error("invalid 'end', not inside of a scope or namespace", m_last_cmd_pos);
|
throw parser_error("invalid 'end', not inside of a scope or namespace", m_last_cmd_pos);
|
||||||
scope_kind k = m_scope_kinds.back();
|
scope_kind k = m_scope_kinds.back();
|
||||||
m_scope_kinds.pop_back();
|
m_scope_kinds.pop_back();
|
||||||
|
m_script_state->apply([&](lua_State * L) { lua_gc(L, LUA_GCCOLLECT, LUA_TUSERDATA); });
|
||||||
switch (k) {
|
switch (k) {
|
||||||
case scope_kind::Scope: {
|
case scope_kind::Scope: {
|
||||||
if (!m_env->has_parent())
|
if (!m_env->has_parent())
|
||||||
|
|
Loading…
Reference in a new issue