X Tutup
Skip to content

Commit 444d808

Browse files
committed
Assign True instead of None to __clear_reentry_guard__
Not at all sure why this helps, but when assigning `None` instead, the object is gone at the time of garbage collection.
1 parent e14465b commit 444d808

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/runtime/Types/ClassBase.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,12 @@ internal static unsafe int BaseUnmanagedClear(BorrowedReference ob)
392392
using var dict = Runtime.PyObject_GenericGetDict(ob);
393393
if (Runtime.PyMapping_HasKey(dict.Borrow(), PyIdentifier.__clear_reentry_guard__) != 0)
394394
return 0;
395-
int res = Runtime.PyDict_SetItem(dict.Borrow(), PyIdentifier.__clear_reentry_guard__, Runtime.None);
395+
396+
int res = Runtime.PyDict_SetItem(
397+
dict.Borrow(),
398+
PyIdentifier.__clear_reentry_guard__,
399+
Runtime.PyTrue
400+
);
396401
if (res != 0) return res;
397402

398403
res = clear(ob);

0 commit comments

Comments
 (0)
X Tutup