diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 48ecca97..01f1d708 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1848,7 +1848,7 @@ namespace CppSharp.Generators.CSharp var dtor = @class.Methods.FirstOrDefault(method => method.IsDestructor); if (dtor != null) { - if (dtor.Access != AccessSpecifier.Private && @class.HasNonTrivialDestructor) + if (dtor.Access != AccessSpecifier.Private && @class.HasNonTrivialDestructor && !dtor.IsPure) { NativeLibrary library; if (!Options.CheckSymbols || diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h index 92272ce2..43f1e6d8 100644 --- a/tests/Basic/Basic.h +++ b/tests/Basic/Basic.h @@ -531,3 +531,9 @@ template struct DependentType { DependentType(typename T::Dependent* t) { } }; + +class PureDtor +{ +public: + virtual ~PureDtor() = 0; +};