diff --git a/src/common/LuaSupport.cpp b/src/common/LuaSupport.cpp index 57bfc929cbe..07f243f4e03 100644 --- a/src/common/LuaSupport.cpp +++ b/src/common/LuaSupport.cpp @@ -315,6 +315,10 @@ Surge::LuaSupport::SGLD::~SGLD() { std::cout << "Guarded stack leak: [" << label << "] exit=" << nt << " enter=" << top << std::endl; + for (int i = nt; i >= top; i--) + { + std::cout << " " << i << " -> " << lua_typename(L, lua_type(L, i)) << std::endl; + } } #endif } diff --git a/src/common/dsp/WavetableScriptEvaluator.cpp b/src/common/dsp/WavetableScriptEvaluator.cpp index 0764d04a584..ca6dd8d2492 100644 --- a/src/common/dsp/WavetableScriptEvaluator.cpp +++ b/src/common/dsp/WavetableScriptEvaluator.cpp @@ -75,6 +75,7 @@ struct LuaWTEvaluator::Details lua_getglobal(L, "init"); if (!lua_isfunction(L, -1)) { + lua_pop(L, -1); makeEmptyState(true); } else