Skip to content
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

Commit 1ff21ac

Browse files
committed
tp_clear for EventBinding
1 parent 76ba510 commit 1ff21ac

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/runtime/eventbinding.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,12 @@ public static IntPtr tp_repr(IntPtr ob)
120120
Runtime.XDecref(self.target);
121121
self.Dealloc();
122122
}
123+
124+
public static int tp_clear(IntPtr ob)
125+
{
126+
var self = (EventBinding)GetManagedObject(ob);
127+
Runtime.Py_CLEAR(ref self.target);
128+
return 0;
129+
}
123130
}
124131
}

src/runtime/typemanager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal class TypeManager
3030
"tp_clear",
3131
};
3232

33-
public static void Initialize()
33+
internal static void Initialize()
3434
{
3535
Debug.Assert(cache.Count == 0, "Cache should be empty",
3636
"Some errors may occurred on last shutdown");

0 commit comments

Comments
 (0)