@ -16,6 +16,7 @@ using __IntPtr = global::System.IntPtr;
@@ -16,6 +16,7 @@ using __IntPtr = global::System.IntPtr;
[assembly:InternalsVisibleTo("CppSharp.CppParser")]
#pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required
#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference
namespace Std
{
@ -160,17 +161,26 @@ namespace Std
@@ -160,17 +161,26 @@ namespace Std
public void Dispose ( )
{
Dispose ( disposing : true , callNativeDtor : _ _ ownsNativeInstance ) ;
Dispose ( disposing : true , callNativeDtor : _ _ ownsNativeInstance ) ;
}
partial void DisposePartial ( bool disposing ) ;
internal protected virtual void Dispose ( bool disposing , bool callNativeDtor )
internal protected virtual void Dispose ( bool disposing , bool callNativeDtor )
{
if ( _ _ Instance = = IntPtr . Zero )
return ;
NativeToManagedMap . TryRemove ( _ _ Instance , out _ ) ;
DisposePartial ( disposing ) ;
if ( callNativeDtor )
{
var _ _ _ Ty = typeof ( _ Ty ) ;
if ( _ _ _ Ty . IsAssignableFrom ( typeof ( sbyte ) ) )
{
return ;
}
throw new ArgumentOutOfRangeException ( "_Ty" , string . Join ( ", " , new [ ] { typeof ( _ Ty ) . FullName } ) , "global::Std.Allocator<_Ty> maps a C++ template class and therefore it only supports a limited set of types and their subclasses: <sbyte>." ) ;
}
if ( _ _ ownsNativeInstance )
Marshal . FreeHGlobal ( _ _ Instance ) ;
_ _ Instance = IntPtr . Zero ;
@ -299,12 +309,12 @@ namespace Std
@@ -299,12 +309,12 @@ namespace Std
public void Dispose ( )
{
Dispose ( disposing : true , callNativeDtor : _ _ ownsNativeInstance ) ;
Dispose ( disposing : true , callNativeDtor : _ _ ownsNativeInstance ) ;
}
partial void DisposePartial ( bool disposing ) ;
internal protected virtual void Dispose ( bool disposing , bool callNativeDtor )
internal protected virtual void Dispose ( bool disposing , bool callNativeDtor )
{
if ( _ _ Instance = = IntPtr . Zero )
return ;
@ -431,12 +441,12 @@ namespace Std
@@ -431,12 +441,12 @@ namespace Std
public void Dispose ( )
{
Dispose ( disposing : true , callNativeDtor : _ _ ownsNativeInstance ) ;
Dispose ( disposing : true , callNativeDtor : _ _ ownsNativeInstance ) ;
}
partial void DisposePartial ( bool disposing ) ;
internal protected virtual void Dispose ( bool disposing , bool callNativeDtor )
internal protected virtual void Dispose ( bool disposing , bool callNativeDtor )
{
if ( _ _ Instance = = IntPtr . Zero )
return ;