Skip to content

Commit d8b0200

Browse files
authored
fixed crash due to unnecessary decref of a borrowed reference in params array handling (pythonnet#1163)
1 parent 742463e commit d8b0200

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
@@ -372,7 +372,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth
372372
static IntPtr HandleParamsArray(IntPtr args, int arrayStart, int pyArgCount, out bool isNewReference)
373373
{
374374
isNewReference = false;
375-
IntPtr op;
375+
IntPtr op;
376376
// for a params method, we may have a sequence or single/multiple items
377377
// here we look to see if the item at the paramIndex is there or not
378378
// and then if it is a sequence itself.
@@ -390,10 +390,6 @@ static IntPtr HandleParamsArray(IntPtr args, int arrayStart, int pyArgCount, out
390390
{
391391
isNewReference = true;
392392
op = Runtime.PyTuple_GetSlice(args, arrayStart, pyArgCount);
393-
if (item != IntPtr.Zero)
394-
{
395-
Runtime.XDecref(item);
396-
}
397393
}
398394
}
399395
else

0 commit comments

Comments
 (0)