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

Fix process of reference count during GC #35

Closed
y-fujisaki2 opened this issue Sep 11, 2017 · 1 comment
Closed

Fix process of reference count during GC #35

y-fujisaki2 opened this issue Sep 11, 2017 · 1 comment

Comments

@y-fujisaki2
Copy link

When we subtract reference counter of an object, the destructor is automatically called if the value of counter is 0.
At the same time an error occurs, as the GC executed while the destructor is still in running phase.
To eliminate the error, we have added below program which exclude objects from GC in the destructor in line 4.

static void
Wrapper_dealloc(Wrapper *self)
{
PyObject_GC_UnTrack((PyObject )self); //Add this line to eliminate self from GC
Wrapper_clear(self);
self->ob_type->tp_free((PyObject
)self);
}

Patch: zope.security.zip

@y-fujisaki2
Copy link
Author

Thanks so much for quickly marging this fix.

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

1 participant