Commit 39770523 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix weakrefs to sets

parent 3e67f01d
......@@ -877,6 +877,8 @@ using namespace pyston::set;
void BoxedSet::dealloc(Box* _o) noexcept {
BoxedSet* o = (BoxedSet*)_o;
PyObject_ClearWeakRefs(o);
PyObject_GC_UnTrack(o);
for (auto p : o->s) {
Py_DECREF(p.value);
......
......@@ -3883,6 +3883,7 @@ void BoxedClass::dealloc(Box* b) noexcept {
if (PyObject_IS_GC(type))
_PyObject_GC_UNTRACK(type);
// We can for the most part avoid this, but I think it's best not to:
PyObject_ClearWeakRefs((PyObject*)type);
type->clearAttrsForDealloc();
......
# expected: reffail
import weakref
import array
import re
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment