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
|
this->l = l; // I don't get how this doesn't cause crashes later on
|
||||||
|
|
||||||
lua_pushliteral(l, "Luacon_ci");
|
ci = static_cast<LuaScriptInterface *>(commandInterface);
|
||||||
lua_gettable(l, LUA_REGISTRYINDEX);
|
|
||||||
ci = (LuaScriptInterface*)lua_touserdata(l, -1);
|
|
||||||
lua_pop(l, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int LuaComponent::position(lua_State * l)
|
int LuaComponent::position(lua_State * l)
|
||||||
|
@ -297,10 +297,6 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m):
|
|||||||
luaopen_bit(l);
|
luaopen_bit(l);
|
||||||
lua_pop(l, 1);
|
lua_pop(l, 1);
|
||||||
|
|
||||||
lua_pushliteral(l, "Luacon_ci");
|
|
||||||
lua_pushlightuserdata(l, this);
|
|
||||||
lua_settable(l, LUA_REGISTRYINDEX);
|
|
||||||
|
|
||||||
initSimulationAPI();
|
initSimulationAPI();
|
||||||
initInterfaceAPI();
|
initInterfaceAPI();
|
||||||
SetWindow(c->GetView());
|
SetWindow(c->GetView());
|
||||||
|
@ -53,10 +53,7 @@ LuaWindow::LuaWindow(lua_State * l)
|
|||||||
if (sizeY < 10)
|
if (sizeY < 10)
|
||||||
sizeY = 10;
|
sizeY = 10;
|
||||||
|
|
||||||
lua_pushliteral(l, "Luacon_ci");
|
ci = static_cast<LuaScriptInterface *>(commandInterface);
|
||||||
lua_gettable(l, LUA_REGISTRYINDEX);
|
|
||||||
ci = (LuaScriptInterface*)lua_touserdata(l, -1);
|
|
||||||
lua_pop(l, 1);
|
|
||||||
|
|
||||||
class DrawnWindow : public ui::Window
|
class DrawnWindow : public ui::Window
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user