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

在执行lua代码的时候想要中途退出但不关闭app可以怎么做 #24

Open
tghjnjvg opened this issue Apr 12, 2020 · 2 comments

Comments

@tghjnjvg
Copy link

如果销毁栈的话,lua还是会运行

@tghjnjvg
Copy link
Author

lua.close(); //养成良好习惯,在执行完毕后销毁Lua栈。
这句执行lua还是会运行的

@ichenhe
Copy link
Owner

ichenhe commented Apr 21, 2020

Lua 栈仅仅是 Lua 与 java 的桥梁。Lua 是独立运行的,关闭栈不能结束正在执行的 lua 进程。
你也不应该强制结束 lua 进程(正如你不应该强制结束 java 进程一样)以免进入未定义的状态。

建议在 lua 中留一个接口,让 lua 自己结束任务。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants