diff --git a/src/common/dsp/WavetableScriptEvaluator.cpp b/src/common/dsp/WavetableScriptEvaluator.cpp index 8cf30baf249..f14d3a530f5 100644 --- a/src/common/dsp/WavetableScriptEvaluator.cpp +++ b/src/common/dsp/WavetableScriptEvaluator.cpp @@ -84,6 +84,7 @@ struct LuaWTEvaluator::Details if (storage) storage->reportError("Unable to locate generate function", "Wavetable Script Evaluator"); + lua_pop(L, 1); // pop the generate non-function return std::nullopt; } Surge::LuaSupport::setSurgeFunctionEnvironment(L);