Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unpacking LuaObject Variants that come from a different LuaState #42

Open
gilzoide opened this issue Nov 4, 2023 · 0 comments
Open

Comments

@gilzoide
Copy link
Owner

gilzoide commented Nov 4, 2023

In to_lua, we should only unpack LuaObjects to the LuaState that they belong. In case of accessing them in a different LuaState, keep them wrapped in a Variant to avoid problems.

Code that needs patching:

if (LuaObject *lua_obj = Object::cast_to<LuaObject>(value)) {
sol::stack::push(lua_state, lua_obj->get_lua_object());
break;
}

@gilzoide gilzoide converted this from a draft issue Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant