Remove unnecessary lua_pushlightuserdata usage, use commandInterface global instead
This causes a crash when using luajit on aarch64 Android builds. I didn't remove the lua_pushlightuserdata usage in LuaLuna.h because that's external code and beyond my understanding
This commit is contained in:
parent
7d337ab732
commit
d5681d8ed9
@ -18,10 +18,7 @@ LuaComponent::LuaComponent(lua_State * l) : component(nullptr), owner_ref(LUA_RE
|
||||
{
|
||||
this->l = l; // I don't get how this doesn't cause crashes later on
|
||||
|
||||
lua_pushliteral(l, "Luacon_ci");
|
||||
lua_gettable(l, LUA_REGISTRYINDEX);
|
||||
ci = (LuaScriptInterface*)lua_touserdata(l, -1);
|
||||
lua_pop(l, 1);
|
||||
ci = static_cast<LuaScriptInterface *>(commandInterface);
|
||||
}
|
||||
|
||||
int LuaComponent::position(lua_State * l)
|
||||
|
@ -297,10 +297,6 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m):
|
||||
luaopen_bit(l);
|
||||
lua_pop(l, 1);
|
||||
|
||||
lua_pushliteral(l, "Luacon_ci");
|
||||
lua_pushlightuserdata(l, this);
|
||||
lua_settable(l, LUA_REGISTRYINDEX);
|
||||
|
||||
initSimulationAPI();
|
||||
initInterfaceAPI();
|
||||
SetWindow(c->GetView());
|
||||
|
@ -53,10 +53,7 @@ LuaWindow::LuaWindow(lua_State * l)
|
||||
if (sizeY < 10)
|
||||
sizeY = 10;
|
||||
|
||||
lua_pushliteral(l, "Luacon_ci");
|
||||
lua_gettable(l, LUA_REGISTRYINDEX);
|
||||
ci = (LuaScriptInterface*)lua_touserdata(l, -1);
|
||||
lua_pop(l, 1);
|
||||
ci = static_cast<LuaScriptInterface *>(commandInterface);
|
||||
|
||||
class DrawnWindow : public ui::Window
|
||||
{
|
||||
|
Reference in New Issue
Block a user