@@ -341,7 +341,7 @@ internal static void Initialize(bool initSigs = false)
341341 string rtdir = RuntimeEnvironment . GetRuntimeDirectory ( ) ;
342342 IntPtr path = PySys_GetObject ( "path" ) ;
343343 IntPtr item = PyString_FromString ( rtdir ) ;
344- PyList_Append ( path , item ) ;
344+ PyList_Append ( new BorrowedReference ( path ) , item ) ;
345345 XDecref ( item ) ;
346346 AssemblyManager . UpdatePath ( ) ;
347347 }
@@ -1658,22 +1658,22 @@ internal static int PyList_SetItem(IntPtr pointer, long index, IntPtr value)
16581658 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
16591659 private static extern int PyList_SetItem( IntPtr pointer, IntPtr index, IntPtr value) ;
16601660
1661- internal static int PyList_Insert( IntPtr pointer, long index, IntPtr value)
1661+ internal static int PyList_Insert( BorrowedReference pointer, long index, IntPtr value)
16621662 {
16631663 return PyList_Insert( pointer, new IntPtr( index) , value) ;
16641664 }
16651665
16661666 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
1667- private static extern int PyList_Insert( IntPtr pointer, IntPtr index, IntPtr value) ;
1667+ private static extern int PyList_Insert( BorrowedReference pointer, IntPtr index, IntPtr value) ;
16681668
16691669 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
1670- internal static extern int PyList_Append( IntPtr pointer, IntPtr value) ;
1670+ internal static extern int PyList_Append( BorrowedReference pointer, IntPtr value) ;
16711671
16721672 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
1673- internal static extern int PyList_Reverse( IntPtr pointer) ;
1673+ internal static extern int PyList_Reverse( BorrowedReference pointer) ;
16741674
16751675 [ DllImport( _PythonDll, CallingConvention = CallingConvention. Cdecl) ]
1676- internal static extern int PyList_Sort( IntPtr pointer) ;
1676+ internal static extern int PyList_Sort( BorrowedReference pointer) ;
16771677
16781678 internal static IntPtr PyList_GetSlice( IntPtr pointer, long start, long end)
16791679 {
0 commit comments