Browse Source

Only patched the v-table entries for non-dtors in user-derived classes.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/256/merge
Dimitar Dobrev 10 years ago
parent
commit
c2a569e24d
  1. 12
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

12
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -1426,7 +1426,17 @@ namespace CppSharp.Generators.CSharp @@ -1426,7 +1426,17 @@ namespace CppSharp.Generators.CSharp
private void GenerateVTableClassSetupCall(Class @class, bool destructorOnly = false)
{
if (@class.IsDynamic && GetUniqueVTableMethodEntries(@class).Count > 0)
WriteLine("SetupVTables({0});", destructorOnly ? "true" : string.Empty);
{
if (destructorOnly)
{
WriteLine("SetupVTables(true);");
return;
}
var typeFullName = TypePrinter.VisitClassDecl(@class);
if (!string.IsNullOrEmpty(Driver.Options.OutputNamespace))
typeFullName = string.Format("{0}.{1}", Driver.Options.OutputNamespace, typeFullName);
WriteLine("SetupVTables(GetType().FullName == \"{0}\");", typeFullName);
}
}
private void GenerateVTableManagedCall(Method method)

Loading…
Cancel
Save