@@ -1934,9 +1934,12 @@ internal static string PyModule_GetFilename(IntPtr module)
19341934 /// </summary>
19351935 /// <param name="module">The module to add the object to.</param>
19361936 /// <param name="name">The key that will refer to the object.</param>
1937- /// <param name="stolenObject">The object to add to the module.</param>
1937+ /// <param name="stolenObject">
1938+ /// The object to add to the module. The reference will be stolen only if the
1939+ /// method returns 0.
1940+ /// </param>
19381941 /// <returns>Return -1 on error, 0 on success.</returns>
1939- internal static int PyModule_AddObject ( BorrowedReference module , string name , BorrowedReference stolenObject )
1942+ internal static int PyModule_AddObject ( BorrowedReference module , string name , IntPtr stolenObject )
19401943 {
19411944 using var namePtr = new StrPtr ( name , Encoding . UTF8 ) ;
19421945 return Delegates . PyModule_AddObject ( module , namePtr , stolenObject ) ;
@@ -2498,7 +2501,7 @@ static Delegates()
24982501 {
24992502 PyModule_Create2 = ( delegate * unmanaged[ Cdecl] < IntPtr , int , IntPtr > ) GetFunctionByName ( "PyModule_Create2TraceRefs" , GetUnmanagedDll ( _PythonDll ) ) ;
25002503 }
2501- PyModule_AddObject = ( delegate * unmanaged[ Cdecl] < BorrowedReference , StrPtr , BorrowedReference , int > ) GetFunctionByName ( nameof ( PyModule_AddObject ) , GetUnmanagedDll ( _PythonDll ) ) ;
2504+ PyModule_AddObject = ( delegate * unmanaged[ Cdecl] < BorrowedReference , StrPtr , IntPtr , int > ) GetFunctionByName ( nameof ( PyModule_AddObject ) , GetUnmanagedDll ( _PythonDll ) ) ;
25022505 PyImport_Import = ( delegate * unmanaged[ Cdecl] < IntPtr , IntPtr > ) GetFunctionByName ( nameof ( PyImport_Import ) , GetUnmanagedDll ( _PythonDll ) ) ;
25032506 PyImport_ImportModule = ( delegate * unmanaged[ Cdecl] < StrPtr , NewReference > ) GetFunctionByName ( nameof ( PyImport_ImportModule ) , GetUnmanagedDll ( _PythonDll ) ) ;
25042507 PyImport_ReloadModule = ( delegate * unmanaged[ Cdecl] < BorrowedReference , NewReference > ) GetFunctionByName ( nameof ( PyImport_ReloadModule ) , GetUnmanagedDll ( _PythonDll ) ) ;
@@ -2787,7 +2790,7 @@ static Delegates()
27872790 internal static delegate * unmanaged[ Cdecl] < BorrowedReference , BorrowedReference > PyModule_GetDict { get ; }
27882791 internal static delegate * unmanaged[ Cdecl] < IntPtr , StrPtr > PyModule_GetFilename { get ; }
27892792 internal static delegate * unmanaged[ Cdecl] < IntPtr , int , IntPtr > PyModule_Create2 { get ; }
2790- internal static delegate * unmanaged[ Cdecl] < BorrowedReference , StrPtr , BorrowedReference , int > PyModule_AddObject { get ; }
2793+ internal static delegate * unmanaged[ Cdecl] < BorrowedReference , StrPtr , IntPtr , int > PyModule_AddObject { get ; }
27912794 internal static delegate * unmanaged[ Cdecl] < IntPtr , IntPtr > PyImport_Import { get ; }
27922795 internal static delegate * unmanaged[ Cdecl] < StrPtr , NewReference > PyImport_ImportModule { get ; }
27932796 internal static delegate * unmanaged[ Cdecl] < BorrowedReference , NewReference > PyImport_ReloadModule { get ; }
0 commit comments