Skip to content

Commit

Permalink
Don't unconditionally run love.jitsetup when love is used as a library
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Nov 28, 2023
1 parent 6a298a7 commit 696007e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion src/love.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
5 changes: 0 additions & 5 deletions src/modules/love/love.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 696007e

Please sign in to comment.