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

How to stop the embedded python and environment? #244

Closed
arkanoid87 opened this issue Dec 10, 2021 · 3 comments
Closed

How to stop the embedded python and environment? #244

arkanoid87 opened this issue Dec 10, 2021 · 3 comments

Comments

@arkanoid87
Copy link

Is there a reason why Py_FinalizeEx is not available / never called?

@yglukhov
Copy link
Owner

No. Is there a reason it should be?

@arkanoid87
Copy link
Author

During a hunt for memory leaks in an application a developer might want to free all memory allocated by Python before exiting from the application

My case: SciNim/scinim#8

@yglukhov
Copy link
Owner

Dunno, I don't find it too essential to be in nimpy, especially that it's 2 lines away anyway for those who need it, as you demonstrated in SciNim/scinim#8:

proc pyFinalize() =
  let Py_FinalizeEx = cast[proc():int{.pyfunc.}](py_lib.pyLib.module.symAddr("Py_FinalizeEx"))
  doAssert Py_FinalizeEx() == 0

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