From 358c03e26137157ab5353134f5071ff8f70cdfa4 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Sun, 12 Mar 2017 20:59:25 +0200 Subject: [PATCH] Fixed a regression when a method called "dispose" is wrapped. Signed-off-by: Dimitar Dobrev --- src/Generator/Passes/RenamePass.cs | 3 ++- tests/Common/Common.cpp | 4 ++++ tests/Common/Common.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Generator/Passes/RenamePass.cs b/src/Generator/Passes/RenamePass.cs index 0975b8cb..b9a59423 100644 --- a/src/Generator/Passes/RenamePass.cs +++ b/src/Generator/Passes/RenamePass.cs @@ -80,7 +80,8 @@ namespace CppSharp.Passes if (method != null) { return Targets.HasFlag(RenameTargets.Method) && - method.Kind == CXXMethodKind.Normal; + method.Kind == CXXMethodKind.Normal && + method.Name != "dispose"; } var function = decl as Function; diff --git a/tests/Common/Common.cpp b/tests/Common/Common.cpp index cb6c48fe..29229db9 100644 --- a/tests/Common/Common.cpp +++ b/tests/Common/Common.cpp @@ -653,6 +653,10 @@ void HasOverloadsWithDifferentPointerKindsToSameType::overload(const int& i) { } +void HasOverloadsWithDifferentPointerKindsToSameType::dispose() +{ +} + void hasPointerParam(Foo* foo, int i) { } diff --git a/tests/Common/Common.h b/tests/Common/Common.h index b0dfff6a..54cc9a82 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -1212,6 +1212,7 @@ public: void overload(int& i); void overload(int&& i); void overload(const int& i); + void dispose(); }; DLL_API void hasPointerParam(Foo* foo, int i);