Skip to content

Commit 8126db6

Browse files
lostmsuAlexCatarino
authored andcommitted
fixed crash due to unnecessary decref of a borrowed reference in params array handling (pythonnet#1163)
1 parent 034330f commit 8126db6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/runtime/methodbinder.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth
412412
static IntPtr HandleParamsArray(IntPtr args, int arrayStart, int pyArgCount, out bool isNewReference)
413413
{
414414
isNewReference = false;
415-
IntPtr op;
415+
IntPtr op;
416416
// for a params method, we may have a sequence or single/multiple items
417417
// here we look to see if the item at the paramIndex is there or not
418418
// and then if it is a sequence itself.
@@ -430,10 +430,6 @@ static IntPtr HandleParamsArray(IntPtr args, int arrayStart, int pyArgCount, out
430430
{
431431
isNewReference = true;
432432
op = Runtime.PyTuple_GetSlice(args, arrayStart, pyArgCount);
433-
if (item != IntPtr.Zero)
434-
{
435-
Runtime.XDecref(item);
436-
}
437433
}
438434
}
439435
else

0 commit comments

Comments
 (0)