Finalizers and proper dereference of CPython objects

PythonException, PyObjecdt, PyScope have finallizers defined as: ~PyObject() { // We needs to disable Finalizers until it's valid implementation. // Current implementation can produce low probability floating bugs. return; Dispose(); } So the finalizer does not call dispose. Does this mean that I must explicitly Dispose all such objects to ensure no memory leaks? Thanks, Tom

There is a fix for this but the code review and merging of related PR is not complete yet: https://github.com/pythonnet/pythonnet/issues/541 On Fri, Jun 1, 2018, 12:56 PM Tom Unger <tunger@mitem.com> wrote:
PythonException, PyObjecdt, PyScope have finallizers defined as:
~PyObject()
{
// We needs to disable Finalizers until it's valid implementation.
// Current implementation can produce low probability floating bugs.
return;
Dispose();
}
So the finalizer does not call dispose. Does this mean that I must explicitly Dispose all such objects to ensure no memory leaks?
Thanks,
Tom
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org https://mail.python.org/mailman/listinfo/pythondotnet
participants (2)
-
Denis Akhiyarov
-
Tom Unger