-
Notifications
You must be signed in to change notification settings - Fork 289
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
__del__ method is not called #985
Comments
So adding the following C# code at the end of GC.Collect();
GC.WaitForPendingFinalizers(); we could get partial output
The missing of |
I have run into a similar issue when developing the buffer protocol support for Perhaps we could always do collect and wait for pending finalizers when the IronPython process closes. It is less clear what to do in embedded scenarios. |
Interestingly with .NET Framework I get all 4 outputs but with .NET Core only 3 (assuming I add GC collect to |
Steps to Reproduce
If we have a class with
__del__
method:Running the following statements with CPython,
[Expected behavior:]
will get output
[Actual behavior:]
But running with IronPython, there's nothing output.
This blocks #938.
FileIO
,TextIOWrapper
etc classes have finalizer (defined in their base class_IOBase
) callingclose()
. But the finalizer is never called.The text was updated successfully, but these errors were encountered: