PyAPI: free internal Python data using sys.exit(..)
Previously BPY_python_end wasn't called when scripts called sys.exit() because BPY_python_end exited the Python interpreter. Change this behavior to call BPY_python_end without exiting the Python interpreter while freeing Blender/Python data. While leaks in the context of sys.exit aren't especially important it's generally preferable for sys.exit() to match Blender's code-paths for exiting to avoid unexpected behavior.
This commit is contained in:
@@ -23,7 +23,7 @@ extern "C" {
|
||||
|
||||
/** Call #BPY_context_set first. */
|
||||
void BPY_python_start(struct bContext *C, int argc, const char **argv);
|
||||
void BPY_python_end(void);
|
||||
void BPY_python_end(bool do_python_exit);
|
||||
void BPY_python_reset(struct bContext *C);
|
||||
void BPY_python_use_system_env(void);
|
||||
void BPY_python_backtrace(FILE *fp);
|
||||
|
||||
Reference in New Issue
Block a user