Fix bug in plugin caused by not popping the closure from the stack after calling it.

This would've caused the plugin to run out of stack memory eventually.
This commit is contained in:
Sandu Liviu Catalin committed 2018-07-05 21:01:08 +03:00
1 parent 50dec8d958
commit f51b4968ac
3 files changed
+19 -1

No files matched your search

+2
View File
@@ -146,6 +146,8 @@ private:
}
// Make the function call and store the result
const SQRESULT res = sq_call(vm, mArgc + 1, false, !mQuiet);
// Pop the callback object from the stack
sq_pop(vm, 1);
// Validate the result
if (SQ_FAILED(res))
{
+2
View File
@@ -86,6 +86,8 @@ Tasks::Interval Tasks::Task::Execute()
}
// Make the function call and store the result
const SQRESULT res = sq_call(vm, mArgc + 1, false, ErrorHandling::IsEnabled());
// Pop the callback object from the stack
sq_pop(vm, 1);
// Validate the result
if (SQ_FAILED(res))
{