From 696007ee399821bdedd9846a9b9135c451b297dd Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Mon, 27 Nov 2023 23:14:36 -0400 Subject: [PATCH] Don't unconditionally run love.jitsetup when love is used as a library --- src/love.cpp | 2 +- src/modules/love/love.cpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/love.cpp b/src/love.cpp index 5a54c74d9..97673a33a 100644 --- a/src/love.cpp +++ b/src/love.cpp @@ -165,7 +165,7 @@ static DoneAction runlove(int argc, char **argv, int &retval) // LuaJIT-specific setup needs to be done as early as possible - before // get_app_arguments because that loads external library code. This is also - // loaded inside require("love"). Note that it doesn't use the love table. + // loaded inside love's Lua threads. Note that it doesn't use the love table. love_preload(L, luaopen_love_jitsetup, "love.jitsetup"); lua_getglobal(L, "require"); lua_pushstring(L, "love.jitsetup"); diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index ef6f9700c..0202a8526 100644 --- a/src/modules/love/love.cpp +++ b/src/modules/love/love.cpp @@ -410,11 +410,6 @@ int luaopen_love(lua_State *L) for (int i = 0; modules[i].name != nullptr; i++) love::luax_preload(L, modules[i].func, modules[i].name); - // jitsetup is also loaded in the love executable runlove function. It's - // needed here too for threads. Note that it doesn't use the love table. - love::luax_require(L, "love.jitsetup"); - lua_pop(L, 1); - love::luax_insistpinnedthread(L); love::luax_insistglobal(L, "love");