FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add tp_clear for constructorbinding · sdpython/pythonnet@76ba510 · GitHub

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

Repository navigation

Commit 76ba510

Browse files
committed
Add tp_clear for constructorbinding
1 parent 49130c4 commit 76ba510

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎src/runtime/constructorbinding.cs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ public static IntPtr tp_repr(IntPtr ob)
146146
self.Dealloc();
147147
}
148148

149+
public static int tp_clear(IntPtr ob)
150+
{
151+
var self = (ConstructorBinding)GetManagedObject(ob);
152+
Runtime.Py_CLEAR(ref self.repr);
153+
return 0;
154+
}
155+
149156
public static int tp_traverse(IntPtr ob, IntPtr visit, IntPtr arg)
150157
{
151158
var self = (ConstructorBinding)GetManagedObject(ob);
@@ -241,6 +248,13 @@ public static IntPtr tp_repr(IntPtr ob)
241248
self.Dealloc();
242249
}
243250

251+
public static int tp_clear(IntPtr ob)
252+
{
253+
var self = (BoundContructor)GetManagedObject(ob);
254+
Runtime.Py_CLEAR(ref self.repr);
255+
return 0;
256+
}
257+
244258
public static int tp_traverse(IntPtr ob, IntPtr visit, IntPtr arg)
245259
{
246260
var self = (BoundContructor)GetManagedObject(ob);

‎src/runtime/typemanager.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,6 @@ public static IntPtr CreateObjectType()
903903

904904
static partial class SlotTypes
905905
{
906-
private static Dictionary<string, Type> _typeMap = new Dictionary<string, Type>();
907906
private static Dictionary<string, Type> _nameMap = new Dictionary<string, Type>();
908907

909908
static SlotTypes()

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL