File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -154,8 +154,11 @@ extern "C" {
154154 luaL_setfuncs (L, lib, 0 );
155155
156156 // _G.emmy_core
157- lua_pushvalue (L, -1 );
158- lua_setglobal (L, " emmy_core" );
157+ lua_getglobal (L, " _G" );
158+ lua_pushstring (L, " emmy_core" );
159+ lua_pushvalue (L, -3 );
160+ lua_rawset (L, -3 );
161+ lua_pop (L, 1 );
159162
160163 return 1 ;
161164 }
Original file line number Diff line number Diff line change @@ -162,8 +162,11 @@ int emmyHelperInit(lua_State* L) {
162162int luaopen_emmy_helper (lua_State* L) {
163163 initialized = false ;
164164
165+ lua_getglobal (L, " _G" );
166+ lua_pushstring (L, " emmyHelperInit" );
165167 lua_pushcfunction (L, emmyHelperInit);
166- lua_setglobal (L, " emmyHelperInit" );
168+ lua_rawset (L, -3 );
169+ lua_pop (L, 1 );
167170
168171 return 0 ;
169172}
You can’t perform that action at this time.
0 commit comments