Skip to content

Commit 5e2e708

Browse files
committed
Fix decref of locals in RunString.
Copy and paste bug.
1 parent cc7fe9a commit 5e2e708

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/runtime/pythonengine.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ==========================================================================
1+
work// ==========================================================================
22
// This software is subject to the provisions of the Zope Public License,
33
// Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
44
// THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
@@ -436,9 +436,7 @@ public static PyObject RunString(string code, IntPtr globals, IntPtr locals)
436436
{
437437
IntPtr flag = (IntPtr)257; /* Py_file_input */
438438
IntPtr result = Runtime.PyRun_String(code, flag, globals, locals);
439-
Runtime.Decref(locals);
440-
if (result == IntPtr.Zero)
441-
{
439+
if (result == IntPtr.Zero) {
442440
return null;
443441
}
444442
return new PyObject(result);

0 commit comments

Comments
 (0)