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

call os.exit with close=true #332

Closed
starius opened this issue Feb 9, 2015 · 0 comments
Closed

call os.exit with close=true #332

starius opened this issue Feb 9, 2015 · 0 comments

Comments

@starius
Copy link
Contributor

starius commented Feb 9, 2015

I run busted tests of my C/C++ module under valgrind. Because busted calls os.exit(code), Lua state is not closed, destructors of some objects are not called, which looks like memory leak for valgrind. I have an idea how to fix this. Lua >= 5.2 has optional argument "close" of function os.exit, which tells Lua to close Lua state before exiting. On Lua 5.1, workaround is calling collectgarbage() three times. before os.exit().

UPD. Another option for Lua 5.1 is not calling os.exit() at all, if exit code is success.

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

No branches or pull requests

2 participants