mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
Fixed objects which store Lua callback functions to avoid attempting to use dead coroutines when deleting the reference to the callback function. Should fix crashes when coroutines are mixed with those objects.
Also improved the performance of World:rayCast and World:queryBoundingBox.
This commit is contained in:
@@ -39,6 +39,8 @@ int w_World_update(lua_State *L)
|
||||
{
|
||||
World *t = luax_checkworld(L, 1);
|
||||
float dt = (float)luaL_checknumber(L, 2);
|
||||
// Make sure the world callbacks are using the calling Lua thread.
|
||||
t->setCallbacksL(L);
|
||||
luax_catchexcept(L, [&](){ t->update(dt); });
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user