We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8840b2 commit dec7a74Copy full SHA for dec7a74
src/runtime/runtime_state.cs
@@ -146,6 +146,7 @@ private static void RestoreObjects(IntPtr dummyGC)
146
public static IEnumerable<IntPtr> PyGCGetObjects()
147
{
148
var gc = PyImport_ImportModule("gc");
149
+ PythonException.ThrowIfIsNull(gc);
150
var get_objects = PyObject_GetAttrString(gc, "get_objects");
151
var objs = PyObject_CallObject(get_objects, IntPtr.Zero);
152
var length = PyList_Size(objs);
@@ -168,6 +169,7 @@ public static IEnumerable<IntPtr> GetModuleNames()
168
169
var name = PyList_GetItem(names, i);
170
yield return name.DangerousGetAddress();
171
}
172
+ XDecref(names);
173
174
175
private static void AddObjPtrToSet(IntPtr set, IntPtr obj)
0 commit comments