aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/basetypes/MCObject.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/basetypes/MCObject.cpp b/src/core/basetypes/MCObject.cpp
index 7c1d83bb..fbb7cb68 100644
--- a/src/core/basetypes/MCObject.cpp
+++ b/src/core/basetypes/MCObject.cpp
@@ -93,6 +93,10 @@ String * Object::className()
int status;
#ifdef _MSC_VER
String * result = String::uniquedStringWithUTF8Characters(typeid(*this).name());
+ // typeid(*this).name() will return "class mailcore::Object". Therefore, we'll strip the prefix "class " from it.
+ if (result->hasPrefix(MCSTR("class "))) {
+ result = result->substringFromIndex(6);
+ }
#else
char * unmangled = abi::__cxa_demangle(typeid(* this).name(), NULL, NULL, &status);
String * result = String::uniquedStringWithUTF8Characters(unmangled);