Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 802a43a commit 0fdf969Copy full SHA for 0fdf969
2 files changed
src/runtime/classbase.cs
@@ -297,7 +297,7 @@ public static void tp_dealloc(IntPtr ob)
297
public static int tp_clear(IntPtr ob)
298
{
299
ManagedType self = GetManagedObject(ob);
300
- if (self.pyHandle != self.tpHandle)
+ if (!self.IsTypeObject())
301
302
ClearObjectDict(ob);
303
}
src/runtime/managedtype.cs
@@ -136,6 +136,11 @@ internal static bool IsManagedType(IntPtr ob)
136
return false;
137
138
139
+ public bool IsTypeObject()
140
+ {
141
+ return pyHandle == tpHandle;
142
+ }
143
+
144
internal static IDictionary<ManagedType, TrackTypes> GetManagedObjects()
145
146
return _managedObjs;
0 commit comments