mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-12-22 19:30:05 +00:00
Fixed stack issue with lEvents
This commit is contained in:
parent
a29de394ee
commit
aa3dacc84b
@ -189,6 +189,11 @@ public:
|
||||
switch (event->type) {
|
||||
case EVENT_CALLBACK: {
|
||||
// make thread for this callback
|
||||
if (!lua_checkstack(event->state, 1)) {
|
||||
std::cout << "[FATAL] Failed to create new lua thread! out of memory!" << std::endl;
|
||||
terminate(0);
|
||||
}
|
||||
|
||||
lua_State *nThread = lua_newthread(event->state);
|
||||
|
||||
// push the callable first, the push all the arguments
|
||||
@ -197,9 +202,6 @@ public:
|
||||
|
||||
// then call it :)
|
||||
yieldCall(nThread, nargs);
|
||||
|
||||
// we can safely pop the thread off the stack now
|
||||
lua_pop(event->state, 1);
|
||||
break;
|
||||
}
|
||||
case EVENT_WAIT: {
|
||||
|
Loading…
Reference in New Issue
Block a user