diff --git a/core/metacling/src/TClingTypeInfo.cxx b/core/metacling/src/TClingTypeInfo.cxx index ae66e67bacc99..10e5cc58465dd 100644 --- a/core/metacling/src/TClingTypeInfo.cxx +++ b/core/metacling/src/TClingTypeInfo.cxx @@ -104,12 +104,13 @@ const char *TClingTypeInfo::Name() const if (!IsValid()) { return ""; } - if (!fNameCache.empty()) - return fNameCache.c_str(); + // Note: This *must* be static because we are returning a pointer inside it! + TTHREAD_TLS_DECL( std::string, buf); + buf.clear(); R__LOCKGUARD(gInterpreterMutex); - ROOT::TMetaUtils::GetFullyQualifiedTypeName(fNameCache, fQualType, *fInterp); - return fNameCache.c_str(); + ROOT::TMetaUtils::GetFullyQualifiedTypeName(buf,fQualType,*fInterp); + return buf.c_str(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/core/metacling/src/TClingTypeInfo.h b/core/metacling/src/TClingTypeInfo.h index 6ebfb93a89529..f13161fea8f93 100644 --- a/core/metacling/src/TClingTypeInfo.h +++ b/core/metacling/src/TClingTypeInfo.h @@ -27,8 +27,6 @@ #include "clang/AST/Type.h" -#include - namespace cling { class Interpreter; } @@ -44,8 +42,6 @@ class TClingTypeInfo { private: cling::Interpreter *fInterp; //Cling interpreter, we do *not* own. clang::QualType fQualType; //Clang qualified type we are querying. - // FIXME: Factor out in the TClingGenericInfo or a similar concept. - mutable std::string fNameCache; public: @@ -57,13 +53,6 @@ class TClingTypeInfo { TClingTypeInfo(cling::Interpreter *interp, const char *name); - TClingTypeInfo(TClingTypeInfo& rhs) - { - fInterp = rhs.fInterp; - fQualType = rhs.fQualType; - fNameCache = ""; // we must not copy the cache. - } - cling::Interpreter *GetInterpreter() const { return fInterp; } clang::QualType GetQualType() const { return fQualType; }