From 3402952388c9c741b24e7902a1f49c92f504e575 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Mon, 21 Dec 2015 01:22:03 +0200 Subject: [PATCH] Called the most derived destructor when it's not virtual. Signed-off-by: Dimitar Dobrev --- src/CppParser/AST.cpp | 41 ++ src/CppParser/AST.h | 21 +- src/CppParser/Bindings/CLI/AST.cpp | 240 ++++++++++ .../CSharp/i686-apple-darwin12.4.0/AST.cs | 450 ++++++++++++++++-- .../Bindings/CSharp/i686-pc-win32-msvc/AST.cs | 450 ++++++++++++++++-- .../CSharp/x86_64-apple-darwin12.4.0/AST.cs | 450 ++++++++++++++++-- .../Bindings/CSharp/x86_64-linux-gnu/AST.cs | 366 +++++++++++++- .../Generators/CLI/CLISourcesTemplate.cs | 9 + .../Generators/CSharp/CSharpTextTemplate.cs | 5 +- tests/Common/Common.Tests.cs | 9 + tests/Common/Common.cpp | 18 + tests/Common/Common.h | 31 ++ 12 files changed, 1949 insertions(+), 141 deletions(-) diff --git a/src/CppParser/AST.cpp b/src/CppParser/AST.cpp index 54ebd48c..c5b36691 100644 --- a/src/CppParser/AST.cpp +++ b/src/CppParser/AST.cpp @@ -67,6 +67,9 @@ TagType::TagType() : Type(TypeKind::Tag) {} ArrayType::ArrayType() : Type(TypeKind::Array) {} FunctionType::FunctionType() : Type(TypeKind::Function) {} + +FunctionType::~FunctionType() {} + DEF_VECTOR(FunctionType, Parameter*, Parameters) PointerType::PointerType() : Type(TypeKind::Pointer) {} @@ -90,6 +93,8 @@ TemplateSpecializationType::TemplateSpecializationType( const TemplateSpecializationType& rhs) : Type(rhs), Arguments(rhs.Arguments), Template(rhs.Template), Desugared(rhs.Desugared) {} +TemplateSpecializationType::~TemplateSpecializationType() {} + DEF_VECTOR(TemplateSpecializationType, TemplateArgument, Arguments) // TemplateParameter @@ -108,6 +113,8 @@ DEF_STRING(TemplateParameter, Name) TemplateParameterType::TemplateParameterType() : Type(TypeKind::TemplateParameter) {} +TemplateParameterType::~TemplateParameterType() {} + TemplateParameterSubstitutionType::TemplateParameterSubstitutionType() : Type(TypeKind::TemplateParameterSubstitution) {} @@ -474,8 +481,12 @@ Friend* DeclarationContext::FindFriend(const std::string& USR) TypedefDecl::TypedefDecl() : Declaration(DeclarationKind::Typedef) {} +TypedefDecl::~TypedefDecl() {} + Friend::Friend() : CppSharp::CppParser::AST::Declaration(DeclarationKind::Friend), Declaration(0) {} +Friend::~Friend() {} + DEF_STRING(Statement, String) Statement::Statement(const std::string& str, StatementClass stmtClass, Declaration* decl) : String(str), Class(stmtClass), Decl(decl) {} @@ -532,6 +543,8 @@ Function::Function() { } +Function::~Function() {} + DEF_STRING(Function, Mangled) DEF_STRING(Function, Signature) DEF_VECTOR(Function, Parameter*, Parameters) @@ -552,11 +565,15 @@ Method::Method() Kind = DeclarationKind::Method; } +Method::~Method() {} + // Enumeration Enumeration::Enumeration() : DeclarationContext(DeclarationKind::Enumeration), Modifiers((EnumModifiers)0), Type(0), BuiltinType(0) {} +Enumeration::~Enumeration() {} + DEF_VECTOR(Enumeration, Enumeration::Item*, Items) Enumeration::Item::Item() : Declaration(DeclarationKind::EnumerationItem) {} @@ -564,6 +581,8 @@ Enumeration::Item::Item() : Declaration(DeclarationKind::EnumerationItem) {} Enumeration::Item::Item(const Item& rhs) : Declaration(rhs), Expression(rhs.Expression), Value(rhs.Value) {} +Enumeration::Item::~Item() {} + DEF_STRING(Enumeration::Item, Expression) Enumeration::Item* Enumeration::FindItemByName(const std::string& Name) @@ -577,6 +596,8 @@ Enumeration::Item* Enumeration::FindItemByName(const std::string& Name) Variable::Variable() : Declaration(DeclarationKind::Variable) {} +Variable::~Variable() {} + DEF_STRING(Variable, Mangled) BaseClassSpecifier::BaseClassSpecifier() : Type(0), Offset(0) {} @@ -584,9 +605,13 @@ BaseClassSpecifier::BaseClassSpecifier() : Type(0), Offset(0) {} Field::Field() : Declaration(DeclarationKind::Field), Class(0), IsBitField(false), BitWidth(0) {} +Field::~Field() {} + AccessSpecifierDecl::AccessSpecifierDecl() : Declaration(DeclarationKind::AccessSpecifier) {} +AccessSpecifierDecl::~AccessSpecifierDecl() {} + Class::Class() : DeclarationContext(DeclarationKind::Class) , IsPOD(false) @@ -620,6 +645,8 @@ DEF_VECTOR(Template, TemplateParameter, Parameters) ClassTemplate::ClassTemplate() : Template(DeclarationKind::ClassTemplate) {} +ClassTemplate::~ClassTemplate() {} + DEF_VECTOR(ClassTemplate, ClassTemplateSpecialization*, Specializations) ClassTemplateSpecialization::ClassTemplateSpecialization() @@ -629,6 +656,8 @@ ClassTemplateSpecialization::ClassTemplateSpecialization() Kind = DeclarationKind::ClassTemplateSpecialization; } +ClassTemplateSpecialization::~ClassTemplateSpecialization() {} + DEF_VECTOR(ClassTemplateSpecialization, TemplateArgument, Arguments) ClassTemplatePartialSpecialization::ClassTemplatePartialSpecialization() @@ -637,8 +666,12 @@ ClassTemplatePartialSpecialization::ClassTemplatePartialSpecialization() Kind = DeclarationKind::ClassTemplatePartialSpecialization; } +ClassTemplatePartialSpecialization::~ClassTemplatePartialSpecialization() {} + FunctionTemplate::FunctionTemplate() : Template(DeclarationKind::FunctionTemplate) {} +FunctionTemplate::~FunctionTemplate() {} + DEF_VECTOR(FunctionTemplate, FunctionTemplateSpecialization*, Specializations) FunctionTemplateSpecialization* FunctionTemplate::FindSpecialization(const std::string& usr) @@ -666,6 +699,8 @@ Namespace::Namespace() { } +Namespace::~Namespace() {} + PreprocessedEntity::PreprocessedEntity() : MacroLocation(AST::MacroLocation::Unknown), OriginalPtr(0), Kind(DeclarationKind::PreprocessedEntity) {} @@ -673,16 +708,22 @@ PreprocessedEntity::PreprocessedEntity() MacroDefinition::MacroDefinition() : LineNumberStart(0), LineNumberEnd(0) { Kind = DeclarationKind::MacroDefinition; } +MacroDefinition::~MacroDefinition() {} + DEF_STRING(MacroDefinition, Name) DEF_STRING(MacroDefinition, Expression) MacroExpansion::MacroExpansion() : Definition(0) { Kind = DeclarationKind::MacroExpansion; } +MacroExpansion::~MacroExpansion() {} + DEF_STRING(MacroExpansion, Name) DEF_STRING(MacroExpansion, Text) TranslationUnit::TranslationUnit() { Kind = DeclarationKind::TranslationUnit; } +TranslationUnit::~TranslationUnit() {} + DEF_STRING(TranslationUnit, FileName) DEF_VECTOR(TranslationUnit, MacroDefinition*, Macros) diff --git a/src/CppParser/AST.h b/src/CppParser/AST.h index 49c4d2d4..5a87e0d7 100644 --- a/src/CppParser/AST.h +++ b/src/CppParser/AST.h @@ -102,6 +102,7 @@ enum class CallingConvention class CS_API FunctionType : public Type { public: + ~FunctionType(); DECLARE_TYPE_KIND(Function) QualifiedType ReturnType; CppSharp::CppParser::AST::CallingConvention CallingConvention; @@ -186,6 +187,7 @@ class CS_API TemplateSpecializationType : public Type public: TemplateSpecializationType(); TemplateSpecializationType(const TemplateSpecializationType&); + ~TemplateSpecializationType(); VECTOR(TemplateArgument, Arguments) CppSharp::CppParser::AST::Template* Template; @@ -210,6 +212,7 @@ public: class CS_API TemplateParameterType : public Type { public: + ~TemplateParameterType(); DECLARE_TYPE_KIND(TemplateParameter) TemplateParameter Parameter; unsigned int Depth; @@ -467,6 +470,7 @@ class CS_API TypedefDecl : public Declaration { public: DECLARE_DECL_KIND(TypedefDecl, Typedef) + ~TypedefDecl(); CppSharp::CppParser::AST::QualifiedType QualifiedType; }; @@ -474,6 +478,7 @@ class CS_API Friend : public Declaration { public: DECLARE_DECL_KIND(Friend, Friend) + ~Friend(); CppSharp::CppParser::AST::Declaration* Declaration; }; @@ -608,6 +613,7 @@ class CS_API Function : public Declaration { public: Function(); + ~Function(); QualifiedType ReturnType; bool IsReturnIndirect; @@ -631,6 +637,7 @@ class CS_API Method : public Function { public: Method(); + ~Method(); AccessSpecifierDecl* AccessDecl; @@ -654,12 +661,14 @@ class CS_API Enumeration : public DeclarationContext { public: DECLARE_DECL_KIND(Enumeration, Enumeration) + ~Enumeration(); class CS_API Item : public Declaration { public: DECLARE_DECL_KIND(Item, EnumerationItem) Item(const Item&); + ~Item(); STRING(Expression) uint64_t Value; @@ -684,7 +693,7 @@ class CS_API Variable : public Declaration { public: DECLARE_DECL_KIND(Variable, Variable) - + ~Variable(); STRING(Mangled) CppSharp::CppParser::AST::QualifiedType QualifiedType; }; @@ -706,6 +715,7 @@ class CS_API Field : public Declaration { public: DECLARE_DECL_KIND(Field, Field) + ~Field(); CppSharp::CppParser::AST::QualifiedType QualifiedType; unsigned Offset; CppSharp::CppParser::AST::Class* Class; @@ -717,6 +727,7 @@ class CS_API AccessSpecifierDecl : public Declaration { public: DECLARE_DECL_KIND(AccessSpecifierDecl, AccessSpecifier) + ~AccessSpecifierDecl(); }; class CS_API Class : public DeclarationContext @@ -759,6 +770,7 @@ class CS_API ClassTemplate : public Template { public: ClassTemplate(); + ~ClassTemplate(); VECTOR(ClassTemplateSpecialization*, Specializations) ClassTemplateSpecialization* FindSpecialization(const std::string& usr); ClassTemplatePartialSpecialization* FindPartialSpecialization(const std::string& usr); @@ -777,6 +789,7 @@ class CS_API ClassTemplateSpecialization : public Class { public: ClassTemplateSpecialization(); + ~ClassTemplateSpecialization(); ClassTemplate* TemplatedDecl; VECTOR(TemplateArgument, Arguments) TemplateSpecializationKind SpecializationKind; @@ -786,12 +799,14 @@ class CS_API ClassTemplatePartialSpecialization : public ClassTemplateSpecializa { public: ClassTemplatePartialSpecialization(); + ~ClassTemplatePartialSpecialization(); }; class CS_API FunctionTemplate : public Template { public: FunctionTemplate(); + ~FunctionTemplate(); VECTOR(FunctionTemplateSpecialization*, Specializations) FunctionTemplateSpecialization* FindSpecialization(const std::string& usr); }; @@ -810,6 +825,7 @@ class CS_API Namespace : public DeclarationContext { public: Namespace(); + ~Namespace(); bool IsInline; }; @@ -836,6 +852,7 @@ class CS_API MacroDefinition : public PreprocessedEntity { public: MacroDefinition(); + ~MacroDefinition(); STRING(Name) STRING(Expression) int LineNumberStart; @@ -846,6 +863,7 @@ class CS_API MacroExpansion : public PreprocessedEntity { public: MacroExpansion(); + ~MacroExpansion(); STRING(Name) STRING(Text) MacroDefinition* Definition; @@ -855,6 +873,7 @@ class CS_API TranslationUnit : public Namespace { public: TranslationUnit(); + ~TranslationUnit(); STRING(FileName) bool IsSystemHeader; VECTOR(MacroDefinition*, Macros) diff --git a/src/CppParser/Bindings/CLI/AST.cpp b/src/CppParser/Bindings/CLI/AST.cpp index 1cf38349..a8ca0912 100644 --- a/src/CppParser/Bindings/CLI/AST.cpp +++ b/src/CppParser/Bindings/CLI/AST.cpp @@ -321,6 +321,12 @@ CppSharp::Parser::AST::FunctionType^ CppSharp::Parser::AST::FunctionType::__Crea CppSharp::Parser::AST::FunctionType::~FunctionType() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::FunctionType*) __nativePtr; + } } CppSharp::Parser::AST::FunctionType::FunctionType() @@ -724,6 +730,12 @@ CppSharp::Parser::AST::TemplateSpecializationType^ CppSharp::Parser::AST::Templa CppSharp::Parser::AST::TemplateSpecializationType::~TemplateSpecializationType() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::TemplateSpecializationType*) __nativePtr; + } } CppSharp::Parser::AST::TemplateSpecializationType::TemplateSpecializationType() @@ -883,6 +895,12 @@ CppSharp::Parser::AST::TemplateParameterType^ CppSharp::Parser::AST::TemplatePar CppSharp::Parser::AST::TemplateParameterType::~TemplateParameterType() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::TemplateParameterType*) __nativePtr; + } } CppSharp::Parser::AST::TemplateParameterType::TemplateParameterType() @@ -1723,6 +1741,12 @@ CppSharp::Parser::AST::DeclarationContext^ CppSharp::Parser::AST::DeclarationCon CppSharp::Parser::AST::DeclarationContext::~DeclarationContext() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::DeclarationContext*) __nativePtr; + } } CppSharp::Parser::AST::DeclarationContext::DeclarationContext(CppSharp::Parser::AST::DeclarationKind kind) @@ -1973,6 +1997,12 @@ CppSharp::Parser::AST::TypedefDecl^ CppSharp::Parser::AST::TypedefDecl::__Create CppSharp::Parser::AST::TypedefDecl::~TypedefDecl() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::TypedefDecl*) __nativePtr; + } } CppSharp::Parser::AST::TypedefDecl::TypedefDecl() @@ -2014,6 +2044,12 @@ CppSharp::Parser::AST::Friend^ CppSharp::Parser::AST::Friend::__CreateInstance(: CppSharp::Parser::AST::Friend::~Friend() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Friend*) __nativePtr; + } } CppSharp::Parser::AST::Friend::Friend() @@ -2124,6 +2160,12 @@ CppSharp::Parser::AST::Expression^ CppSharp::Parser::AST::Expression::__CreateIn CppSharp::Parser::AST::Expression::~Expression() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Expression*) __nativePtr; + } } CppSharp::Parser::AST::Expression::Expression(CppSharp::Parser::AST::Expression^ _0) @@ -2148,6 +2190,12 @@ CppSharp::Parser::AST::BinaryOperator^ CppSharp::Parser::AST::BinaryOperator::__ CppSharp::Parser::AST::BinaryOperator::~BinaryOperator() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::BinaryOperator*) __nativePtr; + } } CppSharp::Parser::AST::BinaryOperator::BinaryOperator(CppSharp::Parser::AST::BinaryOperator^ _0) @@ -2206,6 +2254,12 @@ CppSharp::Parser::AST::CallExpr^ CppSharp::Parser::AST::CallExpr::__CreateInstan CppSharp::Parser::AST::CallExpr::~CallExpr() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::CallExpr*) __nativePtr; + } } CppSharp::Parser::AST::Expression^ CppSharp::Parser::AST::CallExpr::getArguments(unsigned int i) @@ -2256,6 +2310,12 @@ CppSharp::Parser::AST::CXXConstructExpr^ CppSharp::Parser::AST::CXXConstructExpr CppSharp::Parser::AST::CXXConstructExpr::~CXXConstructExpr() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::CXXConstructExpr*) __nativePtr; + } } CppSharp::Parser::AST::Expression^ CppSharp::Parser::AST::CXXConstructExpr::getArguments(unsigned int i) @@ -2306,6 +2366,12 @@ CppSharp::Parser::AST::Parameter^ CppSharp::Parser::AST::Parameter::__CreateInst CppSharp::Parser::AST::Parameter::~Parameter() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Parameter*) __nativePtr; + } } CppSharp::Parser::AST::Parameter::Parameter() @@ -2387,6 +2453,12 @@ CppSharp::Parser::AST::Function^ CppSharp::Parser::AST::Function::__CreateInstan CppSharp::Parser::AST::Function::~Function() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Function*) __nativePtr; + } } CppSharp::Parser::AST::Function::Function() @@ -2572,6 +2644,12 @@ CppSharp::Parser::AST::Method^ CppSharp::Parser::AST::Method::__CreateInstance(: CppSharp::Parser::AST::Method::~Method() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Method*) __nativePtr; + } } CppSharp::Parser::AST::Method::Method() @@ -2723,6 +2801,12 @@ CppSharp::Parser::AST::Enumeration::Item^ CppSharp::Parser::AST::Enumeration::It CppSharp::Parser::AST::Enumeration::Item::~Item() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Enumeration::Item*) __nativePtr; + } } CppSharp::Parser::AST::Enumeration::Item::Item() @@ -2778,6 +2862,12 @@ CppSharp::Parser::AST::Enumeration^ CppSharp::Parser::AST::Enumeration::__Create CppSharp::Parser::AST::Enumeration::~Enumeration() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Enumeration*) __nativePtr; + } } CppSharp::Parser::AST::Enumeration::Enumeration() @@ -2865,6 +2955,12 @@ CppSharp::Parser::AST::Variable^ CppSharp::Parser::AST::Variable::__CreateInstan CppSharp::Parser::AST::Variable::~Variable() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Variable*) __nativePtr; + } } CppSharp::Parser::AST::Variable::Variable() @@ -3001,6 +3097,12 @@ CppSharp::Parser::AST::Field^ CppSharp::Parser::AST::Field::__CreateInstance(::S CppSharp::Parser::AST::Field::~Field() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Field*) __nativePtr; + } } CppSharp::Parser::AST::Field::Field() @@ -3082,6 +3184,12 @@ CppSharp::Parser::AST::AccessSpecifierDecl^ CppSharp::Parser::AST::AccessSpecifi CppSharp::Parser::AST::AccessSpecifierDecl::~AccessSpecifierDecl() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::AccessSpecifierDecl*) __nativePtr; + } } CppSharp::Parser::AST::AccessSpecifierDecl::AccessSpecifierDecl() @@ -3113,6 +3221,12 @@ CppSharp::Parser::AST::Class^ CppSharp::Parser::AST::Class::__CreateInstance(::S CppSharp::Parser::AST::Class::~Class() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Class*) __nativePtr; + } } CppSharp::Parser::AST::Class::Class() @@ -3348,6 +3462,12 @@ CppSharp::Parser::AST::Template^ CppSharp::Parser::AST::Template::__CreateInstan CppSharp::Parser::AST::Template::~Template() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Template*) __nativePtr; + } } CppSharp::Parser::AST::Template::Template(CppSharp::Parser::AST::DeclarationKind kind) @@ -3423,6 +3543,12 @@ CppSharp::Parser::AST::ClassTemplate^ CppSharp::Parser::AST::ClassTemplate::__Cr CppSharp::Parser::AST::ClassTemplate::~ClassTemplate() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::ClassTemplate*) __nativePtr; + } } CppSharp::Parser::AST::ClassTemplate::ClassTemplate() @@ -3480,6 +3606,12 @@ CppSharp::Parser::AST::ClassTemplateSpecialization^ CppSharp::Parser::AST::Class CppSharp::Parser::AST::ClassTemplateSpecialization::~ClassTemplateSpecialization() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::ClassTemplateSpecialization*) __nativePtr; + } } CppSharp::Parser::AST::ClassTemplateSpecialization::ClassTemplateSpecialization() @@ -3557,6 +3689,12 @@ CppSharp::Parser::AST::ClassTemplatePartialSpecialization^ CppSharp::Parser::AST CppSharp::Parser::AST::ClassTemplatePartialSpecialization::~ClassTemplatePartialSpecialization() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization*) __nativePtr; + } } CppSharp::Parser::AST::ClassTemplatePartialSpecialization::ClassTemplatePartialSpecialization() @@ -3588,6 +3726,12 @@ CppSharp::Parser::AST::FunctionTemplate^ CppSharp::Parser::AST::FunctionTemplate CppSharp::Parser::AST::FunctionTemplate::~FunctionTemplate() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::FunctionTemplate*) __nativePtr; + } } CppSharp::Parser::AST::FunctionTemplate::FunctionTemplate() @@ -3742,6 +3886,12 @@ CppSharp::Parser::AST::Namespace^ CppSharp::Parser::AST::Namespace::__CreateInst CppSharp::Parser::AST::Namespace::~Namespace() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::Namespace*) __nativePtr; + } } CppSharp::Parser::AST::Namespace::Namespace() @@ -3854,6 +4004,12 @@ CppSharp::Parser::AST::MacroDefinition^ CppSharp::Parser::AST::MacroDefinition:: CppSharp::Parser::AST::MacroDefinition::~MacroDefinition() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::MacroDefinition*) __nativePtr; + } } CppSharp::Parser::AST::MacroDefinition::MacroDefinition() @@ -3933,6 +4089,12 @@ CppSharp::Parser::AST::MacroExpansion^ CppSharp::Parser::AST::MacroExpansion::__ CppSharp::Parser::AST::MacroExpansion::~MacroExpansion() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::MacroExpansion*) __nativePtr; + } } CppSharp::Parser::AST::MacroExpansion::MacroExpansion() @@ -4002,6 +4164,12 @@ CppSharp::Parser::AST::TranslationUnit^ CppSharp::Parser::AST::TranslationUnit:: CppSharp::Parser::AST::TranslationUnit::~TranslationUnit() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::TranslationUnit*) __nativePtr; + } } CppSharp::Parser::AST::TranslationUnit::TranslationUnit() @@ -4356,6 +4524,12 @@ CppSharp::Parser::AST::FullComment^ CppSharp::Parser::AST::FullComment::__Create CppSharp::Parser::AST::FullComment::~FullComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::FullComment*) __nativePtr; + } } CppSharp::Parser::AST::FullComment::FullComment() @@ -4468,6 +4642,12 @@ CppSharp::Parser::AST::BlockCommandComment^ CppSharp::Parser::AST::BlockCommandC CppSharp::Parser::AST::BlockCommandComment::~BlockCommandComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::BlockCommandComment*) __nativePtr; + } } CppSharp::Parser::AST::BlockCommandComment::BlockCommandComment() @@ -4543,6 +4723,12 @@ CppSharp::Parser::AST::ParamCommandComment^ CppSharp::Parser::AST::ParamCommandC CppSharp::Parser::AST::ParamCommandComment::~ParamCommandComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::ParamCommandComment*) __nativePtr; + } } CppSharp::Parser::AST::ParamCommandComment::ParamCommandComment() @@ -4594,6 +4780,12 @@ CppSharp::Parser::AST::TParamCommandComment^ CppSharp::Parser::AST::TParamComman CppSharp::Parser::AST::TParamCommandComment::~TParamCommandComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::TParamCommandComment*) __nativePtr; + } } CppSharp::Parser::AST::TParamCommandComment::TParamCommandComment() @@ -4649,6 +4841,12 @@ CppSharp::Parser::AST::VerbatimBlockLineComment^ CppSharp::Parser::AST::Verbatim CppSharp::Parser::AST::VerbatimBlockLineComment::~VerbatimBlockLineComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::VerbatimBlockLineComment*) __nativePtr; + } } CppSharp::Parser::AST::VerbatimBlockLineComment::VerbatimBlockLineComment() @@ -4694,6 +4892,12 @@ CppSharp::Parser::AST::VerbatimBlockComment^ CppSharp::Parser::AST::VerbatimBloc CppSharp::Parser::AST::VerbatimBlockComment::~VerbatimBlockComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::VerbatimBlockComment*) __nativePtr; + } } CppSharp::Parser::AST::VerbatimBlockComment::VerbatimBlockComment() @@ -4751,6 +4955,12 @@ CppSharp::Parser::AST::VerbatimLineComment^ CppSharp::Parser::AST::VerbatimLineC CppSharp::Parser::AST::VerbatimLineComment::~VerbatimLineComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::VerbatimLineComment*) __nativePtr; + } } CppSharp::Parser::AST::VerbatimLineComment::VerbatimLineComment() @@ -4835,6 +5045,12 @@ CppSharp::Parser::AST::ParagraphComment^ CppSharp::Parser::AST::ParagraphComment CppSharp::Parser::AST::ParagraphComment::~ParagraphComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::ParagraphComment*) __nativePtr; + } } CppSharp::Parser::AST::ParagraphComment::ParagraphComment() @@ -4957,6 +5173,12 @@ CppSharp::Parser::AST::InlineCommandComment^ CppSharp::Parser::AST::InlineComman CppSharp::Parser::AST::InlineCommandComment::~InlineCommandComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::InlineCommandComment*) __nativePtr; + } } CppSharp::Parser::AST::InlineCommandComment::InlineCommandComment() @@ -5132,6 +5354,12 @@ CppSharp::Parser::AST::HTMLStartTagComment^ CppSharp::Parser::AST::HTMLStartTagC CppSharp::Parser::AST::HTMLStartTagComment::~HTMLStartTagComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::HTMLStartTagComment*) __nativePtr; + } } CppSharp::Parser::AST::HTMLStartTagComment::HTMLStartTagComment() @@ -5203,6 +5431,12 @@ CppSharp::Parser::AST::HTMLEndTagComment^ CppSharp::Parser::AST::HTMLEndTagComme CppSharp::Parser::AST::HTMLEndTagComment::~HTMLEndTagComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::HTMLEndTagComment*) __nativePtr; + } } CppSharp::Parser::AST::HTMLEndTagComment::HTMLEndTagComment() @@ -5248,6 +5482,12 @@ CppSharp::Parser::AST::TextComment^ CppSharp::Parser::AST::TextComment::__Create CppSharp::Parser::AST::TextComment::~TextComment() { + if (NativePtr) + { + auto __nativePtr = NativePtr; + NativePtr = 0; + delete (::CppSharp::CppParser::AST::TextComment*) __nativePtr; + } } CppSharp::Parser::AST::TextComment::TextComment() diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs index da00086d..d69c3762 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs @@ -886,7 +886,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST12FunctionTypeC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -927,7 +927,7 @@ namespace CppSharp private static FunctionType.Internal* __CopyValue(FunctionType.Internal native) { var ret = Marshal.AllocHGlobal(32); - CppSharp.Parser.AST.FunctionType.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.FunctionType.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (FunctionType.Internal*) ret; } @@ -965,7 +965,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Parameter getParameters(uint i) @@ -1843,6 +1852,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); @@ -2111,7 +2129,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST21TemplateParameterTypeC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -2132,7 +2150,7 @@ namespace CppSharp private static TemplateParameterType.Internal* __CopyValue(TemplateParameterType.Internal native) { var ret = Marshal.AllocHGlobal(36); - CppSharp.Parser.AST.TemplateParameterType.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TemplateParameterType.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TemplateParameterType.Internal*) ret; } @@ -2170,7 +2188,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateParameter Parameter @@ -4061,6 +4088,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Namespace getNamespaces(uint i) { var __ret = Internal.getNamespaces_0((__Instance + __PointerAdjustment), i); @@ -4391,7 +4427,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST11TypedefDeclC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -4412,7 +4448,7 @@ namespace CppSharp private static TypedefDecl.Internal* __CopyValue(TypedefDecl.Internal native) { var ret = Marshal.AllocHGlobal(100); - CppSharp.Parser.AST.TypedefDecl.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TypedefDecl.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TypedefDecl.Internal*) ret; } @@ -4450,7 +4486,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -4519,7 +4564,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST6FriendC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -4540,7 +4585,7 @@ namespace CppSharp private static Friend.Internal* __CopyValue(Friend.Internal native) { var ret = Marshal.AllocHGlobal(96); - CppSharp.Parser.AST.Friend.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Friend.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Friend.Internal*) ret; } @@ -4578,7 +4623,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Declaration Declaration @@ -4810,6 +4864,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class BinaryOperator : CppSharp.Parser.AST.Expression, IDisposable @@ -4895,6 +4958,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string OpcodeStr { get @@ -5035,6 +5107,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Expression getArguments(uint i) { var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); @@ -5156,6 +5237,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Expression getArguments(uint i) { var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); @@ -5316,6 +5406,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.QualifiedType QualifiedType { get @@ -5466,7 +5565,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST8FunctionC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -5527,7 +5626,7 @@ namespace CppSharp private static Function.Internal* __CopyValue(Function.Internal native) { var ret = Marshal.AllocHGlobal(156); - CppSharp.Parser.AST.Function.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Function.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Function.Internal*) ret; } @@ -5565,7 +5664,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Parameter getParameters(uint i) @@ -5946,6 +6054,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl { get @@ -6169,7 +6286,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST11EnumerationC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -6329,6 +6446,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Expression { get @@ -6372,7 +6498,7 @@ namespace CppSharp private static Enumeration.Internal* __CopyValue(Enumeration.Internal native) { var ret = Marshal.AllocHGlobal(228); - CppSharp.Parser.AST.Enumeration.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Enumeration.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Enumeration.Internal*) ret; } @@ -6410,7 +6536,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Enumeration.Item getItems(uint i) @@ -6548,7 +6683,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST8VariableC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -6579,7 +6714,7 @@ namespace CppSharp private static Variable.Internal* __CopyValue(Variable.Internal native) { var ret = Marshal.AllocHGlobal(112); - CppSharp.Parser.AST.Variable.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Variable.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Variable.Internal*) ret; } @@ -6617,7 +6752,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Mangled @@ -6868,7 +7012,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST5FieldC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -6889,7 +7033,7 @@ namespace CppSharp private static Field.Internal* __CopyValue(Field.Internal native) { var ret = Marshal.AllocHGlobal(116); - CppSharp.Parser.AST.Field.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Field.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Field.Internal*) ret; } @@ -6927,7 +7071,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -7050,7 +7203,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST19AccessSpecifierDeclC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -7071,7 +7224,7 @@ namespace CppSharp private static AccessSpecifierDecl.Internal* __CopyValue(AccessSpecifierDecl.Internal native) { var ret = Marshal.AllocHGlobal(92); - CppSharp.Parser.AST.AccessSpecifierDecl.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.AccessSpecifierDecl.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (AccessSpecifierDecl.Internal*) ret; } @@ -7109,7 +7262,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } } @@ -7337,6 +7499,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BaseClassSpecifier getBases(uint i) { var __ret = Internal.getBases_0((__Instance + __PointerAdjustment), i); @@ -7754,6 +7925,15 @@ namespace CppSharp Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateParameter getParameters(uint i) { var __ret = new CppSharp.Parser.AST.TemplateParameter.Internal(); @@ -7854,7 +8034,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST13ClassTemplateC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -7895,7 +8075,7 @@ namespace CppSharp private static ClassTemplate.Internal* __CopyValue(ClassTemplate.Internal native) { var ret = Marshal.AllocHGlobal(120); - CppSharp.Parser.AST.ClassTemplate.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.ClassTemplate.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (ClassTemplate.Internal*) ret; } @@ -7933,7 +8113,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.ClassTemplateSpecialization getSpecializations(uint i) @@ -8058,7 +8247,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST27ClassTemplateSpecializationC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -8099,7 +8288,7 @@ namespace CppSharp private static ClassTemplateSpecialization.Internal* __CopyValue(ClassTemplateSpecialization.Internal native) { var ret = Marshal.AllocHGlobal(288); - CppSharp.Parser.AST.ClassTemplateSpecialization.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.ClassTemplateSpecialization.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (ClassTemplateSpecialization.Internal*) ret; } @@ -8137,7 +8326,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) @@ -8350,6 +8548,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class FunctionTemplate : CppSharp.Parser.AST.Template, IDisposable @@ -8404,7 +8611,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST16FunctionTemplateC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -8445,7 +8652,7 @@ namespace CppSharp private static FunctionTemplate.Internal* __CopyValue(FunctionTemplate.Internal native) { var ret = Marshal.AllocHGlobal(120); - CppSharp.Parser.AST.FunctionTemplate.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.FunctionTemplate.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (FunctionTemplate.Internal*) ret; } @@ -8483,7 +8690,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.FunctionTemplateSpecialization getSpecializations(uint i) @@ -8838,6 +9054,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public bool IsInline { get @@ -9013,7 +9238,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinitionC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -9054,7 +9279,7 @@ namespace CppSharp private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native) { var ret = Marshal.AllocHGlobal(44); - CppSharp.Parser.AST.MacroDefinition.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.MacroDefinition.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (MacroDefinition.Internal*) ret; } @@ -9092,7 +9317,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.PreprocessedEntity __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name @@ -9179,7 +9413,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansionC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -9220,7 +9454,7 @@ namespace CppSharp private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native) { var ret = Marshal.AllocHGlobal(40); - CppSharp.Parser.AST.MacroExpansion.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.MacroExpansion.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (MacroExpansion.Internal*) ret; } @@ -9258,7 +9492,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.PreprocessedEntity __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name @@ -9370,7 +9613,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST15TranslationUnitC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -9421,7 +9664,7 @@ namespace CppSharp private static TranslationUnit.Internal* __CopyValue(TranslationUnit.Internal native) { var ret = Marshal.AllocHGlobal(232); - CppSharp.Parser.AST.TranslationUnit.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TranslationUnit.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TranslationUnit.Internal*) ret; } @@ -9459,7 +9702,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.MacroDefinition getMacros(uint i) @@ -10188,6 +10440,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BlockContentComment getBlocks(uint i) { var __ret = Internal.getBlocks_0((__Instance + __PointerAdjustment), i); @@ -10458,6 +10719,15 @@ namespace CppSharp Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BlockCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.BlockCommandComment.Argument.Internal(); @@ -10595,6 +10865,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.ParamCommandComment.PassDirection Direction { get @@ -10723,6 +11002,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public uint getPosition(uint i) { var __ret = Internal.getPosition_0((__Instance + __PointerAdjustment), i); @@ -10841,6 +11129,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get @@ -10959,6 +11256,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.VerbatimBlockLineComment getLines(uint i) { var __ret = Internal.getLines_0((__Instance + __PointerAdjustment), i); @@ -11084,6 +11390,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get @@ -11288,6 +11603,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.InlineContentComment getContent(uint i) { var __ret = Internal.getContent_0((__Instance + __PointerAdjustment), i); @@ -11564,6 +11888,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.InlineCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.InlineCommandComment.Argument.Internal(); @@ -11947,6 +12280,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.HTMLStartTagComment.Attribute getAttributes(uint i) { var __ret = new CppSharp.Parser.AST.HTMLStartTagComment.Attribute.Internal(); @@ -12081,6 +12423,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string TagName { get @@ -12186,6 +12537,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs index 04f7eacc..cd6897fd 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs @@ -886,7 +886,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0FunctionType@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -927,7 +927,7 @@ namespace CppSharp private static FunctionType.Internal* __CopyValue(FunctionType.Internal native) { var ret = Marshal.AllocHGlobal(32); - CppSharp.Parser.AST.FunctionType.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.FunctionType.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (FunctionType.Internal*) ret; } @@ -965,7 +965,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Parameter getParameters(uint i) @@ -1843,6 +1852,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); @@ -2111,7 +2129,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0TemplateParameterType@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -2132,7 +2150,7 @@ namespace CppSharp private static TemplateParameterType.Internal* __CopyValue(TemplateParameterType.Internal native) { var ret = Marshal.AllocHGlobal(48); - CppSharp.Parser.AST.TemplateParameterType.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TemplateParameterType.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TemplateParameterType.Internal*) ret; } @@ -2170,7 +2188,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateParameter Parameter @@ -4061,6 +4088,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Namespace getNamespaces(uint i) { var __ret = Internal.getNamespaces_0((__Instance + __PointerAdjustment), i); @@ -4391,7 +4427,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0TypedefDecl@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -4412,7 +4448,7 @@ namespace CppSharp private static TypedefDecl.Internal* __CopyValue(TypedefDecl.Internal native) { var ret = Marshal.AllocHGlobal(136); - CppSharp.Parser.AST.TypedefDecl.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TypedefDecl.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TypedefDecl.Internal*) ret; } @@ -4450,7 +4486,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -4519,7 +4564,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0Friend@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -4540,7 +4585,7 @@ namespace CppSharp private static Friend.Internal* __CopyValue(Friend.Internal native) { var ret = Marshal.AllocHGlobal(132); - CppSharp.Parser.AST.Friend.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Friend.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Friend.Internal*) ret; } @@ -4578,7 +4623,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Declaration Declaration @@ -4810,6 +4864,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class BinaryOperator : CppSharp.Parser.AST.Expression, IDisposable @@ -4895,6 +4958,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string OpcodeStr { get @@ -5035,6 +5107,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Expression getArguments(uint i) { var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); @@ -5156,6 +5237,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Expression getArguments(uint i) { var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); @@ -5316,6 +5406,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.QualifiedType QualifiedType { get @@ -5466,7 +5565,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0Function@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -5527,7 +5626,7 @@ namespace CppSharp private static Function.Internal* __CopyValue(Function.Internal native) { var ret = Marshal.AllocHGlobal(216); - CppSharp.Parser.AST.Function.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Function.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Function.Internal*) ret; } @@ -5565,7 +5664,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Parameter getParameters(uint i) @@ -5946,6 +6054,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl { get @@ -6169,7 +6286,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0Enumeration@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -6329,6 +6446,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Expression { get @@ -6372,7 +6498,7 @@ namespace CppSharp private static Enumeration.Internal* __CopyValue(Enumeration.Internal native) { var ret = Marshal.AllocHGlobal(260); - CppSharp.Parser.AST.Enumeration.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Enumeration.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Enumeration.Internal*) ret; } @@ -6410,7 +6536,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Enumeration.Item getItems(uint i) @@ -6548,7 +6683,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0Variable@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -6579,7 +6714,7 @@ namespace CppSharp private static Variable.Internal* __CopyValue(Variable.Internal native) { var ret = Marshal.AllocHGlobal(160); - CppSharp.Parser.AST.Variable.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Variable.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Variable.Internal*) ret; } @@ -6617,7 +6752,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Mangled @@ -6868,7 +7012,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0Field@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -6889,7 +7033,7 @@ namespace CppSharp private static Field.Internal* __CopyValue(Field.Internal native) { var ret = Marshal.AllocHGlobal(152); - CppSharp.Parser.AST.Field.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Field.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Field.Internal*) ret; } @@ -6927,7 +7071,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -7050,7 +7203,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0AccessSpecifierDecl@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -7071,7 +7224,7 @@ namespace CppSharp private static AccessSpecifierDecl.Internal* __CopyValue(AccessSpecifierDecl.Internal native) { var ret = Marshal.AllocHGlobal(128); - CppSharp.Parser.AST.AccessSpecifierDecl.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.AccessSpecifierDecl.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (AccessSpecifierDecl.Internal*) ret; } @@ -7109,7 +7262,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } } @@ -7337,6 +7499,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BaseClassSpecifier getBases(uint i) { var __ret = Internal.getBases_0((__Instance + __PointerAdjustment), i); @@ -7754,6 +7925,15 @@ namespace CppSharp Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateParameter getParameters(uint i) { var __ret = new CppSharp.Parser.AST.TemplateParameter.Internal(); @@ -7854,7 +8034,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0ClassTemplate@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -7895,7 +8075,7 @@ namespace CppSharp private static ClassTemplate.Internal* __CopyValue(ClassTemplate.Internal native) { var ret = Marshal.AllocHGlobal(156); - CppSharp.Parser.AST.ClassTemplate.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.ClassTemplate.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (ClassTemplate.Internal*) ret; } @@ -7933,7 +8113,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.ClassTemplateSpecialization getSpecializations(uint i) @@ -8058,7 +8247,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0ClassTemplateSpecialization@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -8099,7 +8288,7 @@ namespace CppSharp private static ClassTemplateSpecialization.Internal* __CopyValue(ClassTemplateSpecialization.Internal native) { var ret = Marshal.AllocHGlobal(320); - CppSharp.Parser.AST.ClassTemplateSpecialization.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.ClassTemplateSpecialization.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (ClassTemplateSpecialization.Internal*) ret; } @@ -8137,7 +8326,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) @@ -8350,6 +8548,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class FunctionTemplate : CppSharp.Parser.AST.Template, IDisposable @@ -8404,7 +8611,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0FunctionTemplate@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -8445,7 +8652,7 @@ namespace CppSharp private static FunctionTemplate.Internal* __CopyValue(FunctionTemplate.Internal native) { var ret = Marshal.AllocHGlobal(156); - CppSharp.Parser.AST.FunctionTemplate.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.FunctionTemplate.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (FunctionTemplate.Internal*) ret; } @@ -8483,7 +8690,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.FunctionTemplateSpecialization getSpecializations(uint i) @@ -8838,6 +9054,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public bool IsInline { get @@ -9013,7 +9238,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0MacroDefinition@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -9054,7 +9279,7 @@ namespace CppSharp private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native) { var ret = Marshal.AllocHGlobal(68); - CppSharp.Parser.AST.MacroDefinition.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.MacroDefinition.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (MacroDefinition.Internal*) ret; } @@ -9092,7 +9317,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.PreprocessedEntity __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name @@ -9179,7 +9413,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0MacroExpansion@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -9220,7 +9454,7 @@ namespace CppSharp private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native) { var ret = Marshal.AllocHGlobal(64); - CppSharp.Parser.AST.MacroExpansion.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.MacroExpansion.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (MacroExpansion.Internal*) ret; } @@ -9258,7 +9492,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.PreprocessedEntity __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name @@ -9370,7 +9613,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0TranslationUnit@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")] - internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, @@ -9421,7 +9664,7 @@ namespace CppSharp private static TranslationUnit.Internal* __CopyValue(TranslationUnit.Internal native) { var ret = Marshal.AllocHGlobal(280); - CppSharp.Parser.AST.TranslationUnit.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TranslationUnit.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TranslationUnit.Internal*) ret; } @@ -9459,7 +9702,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.MacroDefinition getMacros(uint i) @@ -10188,6 +10440,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BlockContentComment getBlocks(uint i) { var __ret = Internal.getBlocks_0((__Instance + __PointerAdjustment), i); @@ -10458,6 +10719,15 @@ namespace CppSharp Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BlockCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.BlockCommandComment.Argument.Internal(); @@ -10595,6 +10865,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.ParamCommandComment.PassDirection Direction { get @@ -10723,6 +11002,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public uint getPosition(uint i) { var __ret = Internal.getPosition_0((__Instance + __PointerAdjustment), i); @@ -10841,6 +11129,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get @@ -10959,6 +11256,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.VerbatimBlockLineComment getLines(uint i) { var __ret = Internal.getLines_0((__Instance + __PointerAdjustment), i); @@ -11084,6 +11390,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get @@ -11288,6 +11603,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.InlineContentComment getContent(uint i) { var __ret = Internal.getContent_0((__Instance + __PointerAdjustment), i); @@ -11564,6 +11888,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.InlineCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.InlineCommandComment.Argument.Internal(); @@ -11947,6 +12280,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.HTMLStartTagComment.Attribute getAttributes(uint i) { var __ret = new CppSharp.Parser.AST.HTMLStartTagComment.Attribute.Internal(); @@ -12081,6 +12423,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string TagName { get @@ -12186,6 +12537,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment), 0); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs index 96272a69..03ce42e2 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs @@ -886,7 +886,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST12FunctionTypeC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -927,7 +927,7 @@ namespace CppSharp private static FunctionType.Internal* __CopyValue(FunctionType.Internal native) { var ret = Marshal.AllocHGlobal(56); - CppSharp.Parser.AST.FunctionType.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.FunctionType.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (FunctionType.Internal*) ret; } @@ -965,7 +965,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Parameter getParameters(uint i) @@ -1843,6 +1852,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); @@ -2111,7 +2129,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST21TemplateParameterTypeC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -2132,7 +2150,7 @@ namespace CppSharp private static TemplateParameterType.Internal* __CopyValue(TemplateParameterType.Internal native) { var ret = Marshal.AllocHGlobal(56); - CppSharp.Parser.AST.TemplateParameterType.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TemplateParameterType.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TemplateParameterType.Internal*) ret; } @@ -2170,7 +2188,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateParameter Parameter @@ -4060,6 +4087,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Namespace getNamespaces(uint i) { var __ret = Internal.getNamespaces_0((__Instance + __PointerAdjustment), i); @@ -4390,7 +4426,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST11TypedefDeclC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -4411,7 +4447,7 @@ namespace CppSharp private static TypedefDecl.Internal* __CopyValue(TypedefDecl.Internal native) { var ret = Marshal.AllocHGlobal(184); - CppSharp.Parser.AST.TypedefDecl.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TypedefDecl.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TypedefDecl.Internal*) ret; } @@ -4449,7 +4485,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -4518,7 +4563,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST6FriendC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -4539,7 +4584,7 @@ namespace CppSharp private static Friend.Internal* __CopyValue(Friend.Internal native) { var ret = Marshal.AllocHGlobal(176); - CppSharp.Parser.AST.Friend.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Friend.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Friend.Internal*) ret; } @@ -4577,7 +4622,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Declaration Declaration @@ -4809,6 +4863,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class BinaryOperator : CppSharp.Parser.AST.Expression, IDisposable @@ -4894,6 +4957,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string OpcodeStr { get @@ -5034,6 +5106,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Expression getArguments(uint i) { var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); @@ -5155,6 +5236,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Expression getArguments(uint i) { var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); @@ -5315,6 +5405,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.QualifiedType QualifiedType { get @@ -5465,7 +5564,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST8FunctionC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -5526,7 +5625,7 @@ namespace CppSharp private static Function.Internal* __CopyValue(Function.Internal native) { var ret = Marshal.AllocHGlobal(288); - CppSharp.Parser.AST.Function.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Function.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Function.Internal*) ret; } @@ -5564,7 +5663,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Parameter getParameters(uint i) @@ -5945,6 +6053,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl { get @@ -6168,7 +6285,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST11EnumerationC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -6328,6 +6445,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Expression { get @@ -6371,7 +6497,7 @@ namespace CppSharp private static Enumeration.Internal* __CopyValue(Enumeration.Internal native) { var ret = Marshal.AllocHGlobal(432); - CppSharp.Parser.AST.Enumeration.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Enumeration.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Enumeration.Internal*) ret; } @@ -6409,7 +6535,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Enumeration.Item getItems(uint i) @@ -6547,7 +6682,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST8VariableC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -6578,7 +6713,7 @@ namespace CppSharp private static Variable.Internal* __CopyValue(Variable.Internal native) { var ret = Marshal.AllocHGlobal(208); - CppSharp.Parser.AST.Variable.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Variable.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Variable.Internal*) ret; } @@ -6616,7 +6751,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Mangled @@ -6867,7 +7011,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST5FieldC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -6888,7 +7032,7 @@ namespace CppSharp private static Field.Internal* __CopyValue(Field.Internal native) { var ret = Marshal.AllocHGlobal(208); - CppSharp.Parser.AST.Field.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.Field.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (Field.Internal*) ret; } @@ -6926,7 +7070,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.QualifiedType QualifiedType @@ -7049,7 +7202,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST19AccessSpecifierDeclC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -7070,7 +7223,7 @@ namespace CppSharp private static AccessSpecifierDecl.Internal* __CopyValue(AccessSpecifierDecl.Internal native) { var ret = Marshal.AllocHGlobal(168); - CppSharp.Parser.AST.AccessSpecifierDecl.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.AccessSpecifierDecl.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (AccessSpecifierDecl.Internal*) ret; } @@ -7108,7 +7261,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } } @@ -7336,6 +7498,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BaseClassSpecifier getBases(uint i) { var __ret = Internal.getBases_0((__Instance + __PointerAdjustment), i); @@ -7753,6 +7924,15 @@ namespace CppSharp Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateParameter getParameters(uint i) { var __ret = new CppSharp.Parser.AST.TemplateParameter.Internal(); @@ -7853,7 +8033,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST13ClassTemplateC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -7894,7 +8074,7 @@ namespace CppSharp private static ClassTemplate.Internal* __CopyValue(ClassTemplate.Internal native) { var ret = Marshal.AllocHGlobal(224); - CppSharp.Parser.AST.ClassTemplate.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.ClassTemplate.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (ClassTemplate.Internal*) ret; } @@ -7932,7 +8112,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.ClassTemplateSpecialization getSpecializations(uint i) @@ -8057,7 +8246,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST27ClassTemplateSpecializationC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -8098,7 +8287,7 @@ namespace CppSharp private static ClassTemplateSpecialization.Internal* __CopyValue(ClassTemplateSpecialization.Internal native) { var ret = Marshal.AllocHGlobal(552); - CppSharp.Parser.AST.ClassTemplateSpecialization.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.ClassTemplateSpecialization.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (ClassTemplateSpecialization.Internal*) ret; } @@ -8136,7 +8325,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) @@ -8349,6 +8547,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class FunctionTemplate : CppSharp.Parser.AST.Template, IDisposable @@ -8403,7 +8610,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST16FunctionTemplateC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -8444,7 +8651,7 @@ namespace CppSharp private static FunctionTemplate.Internal* __CopyValue(FunctionTemplate.Internal native) { var ret = Marshal.AllocHGlobal(224); - CppSharp.Parser.AST.FunctionTemplate.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.FunctionTemplate.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (FunctionTemplate.Internal*) ret; } @@ -8482,7 +8689,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.FunctionTemplateSpecialization getSpecializations(uint i) @@ -8837,6 +9053,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public bool IsInline { get @@ -9012,7 +9237,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinitionC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -9053,7 +9278,7 @@ namespace CppSharp private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native) { var ret = Marshal.AllocHGlobal(80); - CppSharp.Parser.AST.MacroDefinition.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.MacroDefinition.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (MacroDefinition.Internal*) ret; } @@ -9091,7 +9316,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.PreprocessedEntity __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name @@ -9178,7 +9412,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansionC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -9219,7 +9453,7 @@ namespace CppSharp private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native) { var ret = Marshal.AllocHGlobal(80); - CppSharp.Parser.AST.MacroExpansion.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.MacroExpansion.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (MacroExpansion.Internal*) ret; } @@ -9257,7 +9491,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.PreprocessedEntity __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public string Name @@ -9369,7 +9612,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST15TranslationUnitC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -9420,7 +9663,7 @@ namespace CppSharp private static TranslationUnit.Internal* __CopyValue(TranslationUnit.Internal native) { var ret = Marshal.AllocHGlobal(448); - CppSharp.Parser.AST.TranslationUnit.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.TranslationUnit.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (TranslationUnit.Internal*) ret; } @@ -9458,7 +9701,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.MacroDefinition getMacros(uint i) @@ -10187,6 +10439,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BlockContentComment getBlocks(uint i) { var __ret = Internal.getBlocks_0((__Instance + __PointerAdjustment), i); @@ -10457,6 +10718,15 @@ namespace CppSharp Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BlockCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.BlockCommandComment.Argument.Internal(); @@ -10594,6 +10864,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.ParamCommandComment.PassDirection Direction { get @@ -10722,6 +11001,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public uint getPosition(uint i) { var __ret = Internal.getPosition_0((__Instance + __PointerAdjustment), i); @@ -10840,6 +11128,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get @@ -10958,6 +11255,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.VerbatimBlockLineComment getLines(uint i) { var __ret = Internal.getLines_0((__Instance + __PointerAdjustment), i); @@ -11083,6 +11389,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get @@ -11287,6 +11602,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.InlineContentComment getContent(uint i) { var __ret = Internal.getContent_0((__Instance + __PointerAdjustment), i); @@ -11563,6 +11887,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.InlineCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.InlineCommandComment.Argument.Internal(); @@ -11946,6 +12279,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.HTMLStartTagComment.Attribute getAttributes(uint i) { var __ret = new CppSharp.Parser.AST.HTMLStartTagComment.Attribute.Internal(); @@ -12080,6 +12422,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string TagName { get @@ -12185,6 +12536,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs index 082caefa..b81e8056 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs @@ -886,7 +886,7 @@ namespace CppSharp [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST12FunctionTypeC2ERKS2_")] - internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0); + internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0); [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, @@ -927,7 +927,7 @@ namespace CppSharp private static FunctionType.Internal* __CopyValue(FunctionType.Internal native) { var ret = Marshal.AllocHGlobal(56); - CppSharp.Parser.AST.FunctionType.Internal.cctor_2(ret, new global::System.IntPtr(&native)); + CppSharp.Parser.AST.FunctionType.Internal.cctor_1(ret, new global::System.IntPtr(&native)); return (FunctionType.Internal*) ret; } @@ -965,7 +965,16 @@ namespace CppSharp if (ReferenceEquals(_0, null)) throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&)."); var arg0 = _0.__Instance; - Internal.cctor_2((__Instance + __PointerAdjustment), arg0); + Internal.cctor_1((__Instance + __PointerAdjustment), arg0); + } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); } public CppSharp.Parser.AST.Parameter getParameters(uint i) @@ -1843,6 +1852,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); @@ -2173,6 +2191,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Type __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateParameter Parameter { get @@ -4060,6 +4087,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Namespace getNamespaces(uint i) { var __ret = Internal.getNamespaces_0((__Instance + __PointerAdjustment), i); @@ -4452,6 +4488,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.QualifiedType QualifiedType { get @@ -4580,6 +4625,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Declaration Declaration { get @@ -4809,6 +4863,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class BinaryOperator : CppSharp.Parser.AST.Expression, IDisposable @@ -4894,6 +4957,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string OpcodeStr { get @@ -5034,6 +5106,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Expression getArguments(uint i) { var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); @@ -5155,6 +5236,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Statement __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Expression getArguments(uint i) { var __ret = Internal.getArguments_0((__Instance + __PointerAdjustment), i); @@ -5315,6 +5405,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.QualifiedType QualifiedType { get @@ -5567,6 +5666,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Parameter getParameters(uint i) { var __ret = Internal.getParameters_0((__Instance + __PointerAdjustment), i); @@ -5945,6 +6053,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl { get @@ -6328,6 +6445,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Expression { get @@ -6412,6 +6538,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.Enumeration.Item getItems(uint i) { var __ret = Internal.getItems_0((__Instance + __PointerAdjustment), i); @@ -6619,6 +6754,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Mangled { get @@ -6929,6 +7073,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.QualifiedType QualifiedType { get @@ -7110,6 +7263,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class Class : CppSharp.Parser.AST.DeclarationContext, IDisposable @@ -7336,6 +7498,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BaseClassSpecifier getBases(uint i) { var __ret = Internal.getBases_0((__Instance + __PointerAdjustment), i); @@ -7753,6 +7924,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateParameter getParameters(uint i) { var __ret = new CppSharp.Parser.AST.TemplateParameter.Internal(); @@ -7935,6 +8115,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.ClassTemplateSpecialization getSpecializations(uint i) { var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); @@ -8139,6 +8328,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.TemplateArgument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.TemplateArgument.Internal(); @@ -8349,6 +8547,15 @@ namespace CppSharp var arg0 = _0.__Instance; Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } } public unsafe partial class FunctionTemplate : CppSharp.Parser.AST.Template, IDisposable @@ -8485,6 +8692,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.FunctionTemplateSpecialization getSpecializations(uint i) { var __ret = Internal.getSpecializations_0((__Instance + __PointerAdjustment), i); @@ -8837,6 +9053,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public bool IsInline { get @@ -9094,6 +9319,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.PreprocessedEntity __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Name { get @@ -9260,6 +9494,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.PreprocessedEntity __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Name { get @@ -9461,6 +9704,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Declaration __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.MacroDefinition getMacros(uint i) { var __ret = Internal.getMacros_0((__Instance + __PointerAdjustment), i); @@ -10187,6 +10439,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BlockContentComment getBlocks(uint i) { var __ret = Internal.getBlocks_0((__Instance + __PointerAdjustment), i); @@ -10457,6 +10718,15 @@ namespace CppSharp Internal.cctor_3((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.BlockCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.BlockCommandComment.Argument.Internal(); @@ -10594,6 +10864,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.ParamCommandComment.PassDirection Direction { get @@ -10722,6 +11001,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public uint getPosition(uint i) { var __ret = Internal.getPosition_0((__Instance + __PointerAdjustment), i); @@ -10840,6 +11128,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get @@ -10958,6 +11255,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.VerbatimBlockLineComment getLines(uint i) { var __ret = Internal.getLines_0((__Instance + __PointerAdjustment), i); @@ -11083,6 +11389,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get @@ -11287,6 +11602,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.InlineContentComment getContent(uint i) { var __ret = Internal.getContent_0((__Instance + __PointerAdjustment), i); @@ -11563,6 +11887,15 @@ namespace CppSharp Internal.cctor_2((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.InlineCommandComment.Argument getArguments(uint i) { var __ret = new CppSharp.Parser.AST.InlineCommandComment.Argument.Internal(); @@ -11946,6 +12279,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public CppSharp.Parser.AST.HTMLStartTagComment.Attribute getAttributes(uint i) { var __ret = new CppSharp.Parser.AST.HTMLStartTagComment.Attribute.Internal(); @@ -12080,6 +12422,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string TagName { get @@ -12185,6 +12536,15 @@ namespace CppSharp Internal.cctor_1((__Instance + __PointerAdjustment), arg0); } + protected override void Dispose(bool disposing) + { + CppSharp.Parser.AST.Comment __dummy; + NativeToManagedMap.TryRemove(__Instance, out __dummy); + Internal.dtor_0((__Instance + __PointerAdjustment)); + if (__ownsNativeInstance) + Marshal.FreeHGlobal(__Instance); + } + public string Text { get diff --git a/src/Generator/Generators/CLI/CLISourcesTemplate.cs b/src/Generator/Generators/CLI/CLISourcesTemplate.cs index 044d5da2..e4529b1b 100644 --- a/src/Generator/Generators/CLI/CLISourcesTemplate.cs +++ b/src/Generator/Generators/CLI/CLISourcesTemplate.cs @@ -259,6 +259,15 @@ namespace CppSharp.Generators.CLI { WriteLine("delete NativePtr;"); } + else if (@class.HasNonTrivialDestructor) + { + WriteLine("if (NativePtr)"); + WriteStartBraceIndent(); + WriteLine("auto __nativePtr = NativePtr;"); + WriteLine("NativePtr = 0;"); + WriteLine("delete (::{0}*) __nativePtr;", @class.QualifiedOriginalName); + WriteCloseBraceIndent(); + } WriteCloseBraceIndent(); diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 09a6fd82..00ca1b7f 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1761,10 +1761,11 @@ namespace CppSharp.Generators.CSharp GenerateClassFinalizer(@class); // ensure any virtual dtor in the chain is called - var dtor = @class.Destructors.FirstOrDefault(d => d.Access != AccessSpecifier.Private && d.IsVirtual); + var dtor = @class.Destructors.FirstOrDefault(d => d.Access != AccessSpecifier.Private); var baseDtor = @class.BaseClass == null ? null : @class.BaseClass.Destructors.FirstOrDefault(d => !d.IsVirtual); - if (ShouldGenerateClassNativeField(@class) || (dtor != null && baseDtor != null) || + if (ShouldGenerateClassNativeField(@class) || + ((dtor != null && (dtor.IsVirtual || @class.HasNonTrivialDestructor)) && baseDtor != null) || // virtual destructors in abstract classes may lack a pointer in the v-table // so they have to be called by symbol; thus we need an explicit Dispose override @class.IsAbstract) diff --git a/tests/Common/Common.Tests.cs b/tests/Common/Common.Tests.cs index 62950d92..7d0905b9 100644 --- a/tests/Common/Common.Tests.cs +++ b/tests/Common/Common.Tests.cs @@ -599,6 +599,15 @@ public class CommonTests : GeneratorTestFixture } } + [Test] + public void TestNonTrivialDtorInvocation() + { + using (var nonTrivialDtor = new NonTrivialDtor()) + { + } + Assert.IsTrue(NonTrivialDtor.DtorCalled); + } + private class CustomDerivedFromVirtual : AbstractWithVirtualDtor { public override void @abstract() diff --git a/tests/Common/Common.cpp b/tests/Common/Common.cpp index de8b362b..ded1bb3a 100644 --- a/tests/Common/Common.cpp +++ b/tests/Common/Common.cpp @@ -584,3 +584,21 @@ AbstractWithVirtualDtor::AbstractWithVirtualDtor() AbstractWithVirtualDtor::~AbstractWithVirtualDtor() { } + +NonTrivialDtorBase::NonTrivialDtorBase() +{ +} + +NonTrivialDtorBase::~NonTrivialDtorBase() +{ +} + +NonTrivialDtor::NonTrivialDtor() +{ + dtorCalled = false; +} + +NonTrivialDtor::~NonTrivialDtor() +{ + dtorCalled = true; +} diff --git a/tests/Common/Common.h b/tests/Common/Common.h index 92126ef7..11e736d0 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -971,3 +971,34 @@ public: virtual ~AbstractWithVirtualDtor(); virtual void abstract() = 0; }; + +class DLL_API NonTrivialDtorBase +{ +public: + NonTrivialDtorBase(); + ~NonTrivialDtorBase(); +}; + +class DLL_API NonTrivialDtor : public NonTrivialDtorBase +{ +public: + NonTrivialDtor(); + ~NonTrivialDtor(); + static bool getDtorCalled(); + static void setDtorCalled(bool value); +private: + static bool dtorCalled; +}; + +// HACK: do not move these to the cpp - C++/CLI is buggy and cannot link static fields initialised in the cpp +bool NonTrivialDtor::dtorCalled = false; + +bool NonTrivialDtor::getDtorCalled() +{ + return true; +} + +void NonTrivialDtor::setDtorCalled(bool value) +{ + dtorCalled = true; +}