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
Python crashes when calling sys.exit() #29
Comments
I have added a new SetLogHandler() function to the LuxCore API so it is now possible a workaround:
Calling "pyluxcore.SetLogHandler(None)" before the end fix the problem. |
So the destructor of the static object attempts to clean up but the interpreter's gone? There's atexit in Python (similar to std::atexit in C++) that lets you register a callback that is invoked before the interpreter dies. That might do to perform a safe tear-down... |
Yes there is a static object holding the reference to a python object (i.e. a function call back to print log messages) and when the destructor of the static object is called, the python interpreter as already gone. It can be solved with the try/finally or with the atexit but both solutions are not transparent for the API user: they must be coded in the application. |
Yes, I meant doing the python Another solution would be to have everything, including the system context in classes, then it would get destroyed when the interpreter shuts down and the cleanup could happen there. |
Python crashes when calling sys.exit() if pyluxcore.Init() was called with an call back. This is due to pyluxcore keeping a reference to the callback in a static boost::python::object. Everything works fine if python code exit normally without calling sys.exit().
I haven't yet found a work around to this problem.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: