diff --git a/source/Logger.cpp b/source/Logger.cpp index 0767fce1..30f3a67b 100644 --- a/source/Logger.cpp +++ b/source/Logger.cpp @@ -410,9 +410,13 @@ template < Uint8 L, bool S > static SQInteger LogBasicMessage(HSQUIRRELVM vm) if (SQ_FAILED(sq_getstring(vm, -1, &msg))) { _Log->Err("Unable to from the stack"); + // Pop any pushed values pushed to the stack + sq_settop(vm, top); // Failed to log the value return 0; } + // Pop any pushed values pushed to the stack + sq_settop(vm, top); // Log the specified string _Log->Message(L, S, "%s", msg); }