diff --git a/core/meta/src/TStreamerElement.cxx b/core/meta/src/TStreamerElement.cxx index f2875f1a3cb61..adc3640a90d21 100644 --- a/core/meta/src/TStreamerElement.cxx +++ b/core/meta/src/TStreamerElement.cxx @@ -30,6 +30,7 @@ #include "ThreadLocalStorage.h" #include "TList.h" #include "TRef.h" +#include "TRefArray.h" #include "TInterpreter.h" #include "TError.h" #include "TObjArray.h" @@ -287,7 +288,7 @@ Bool_t TStreamerElement::CannotSplit() const } //////////////////////////////////////////////////////////////////////////////// -/// Returns a pointer to the TClass of this element. +/// Returns a pointer to the TClass of this element and updates fClassObject. TClass *TStreamerElement::GetClassPointer() const { @@ -305,9 +306,11 @@ TClass *TStreamerElement::GetClassPointer() const Int_t TStreamerElement::GetExecID() const { - //check if element is a TRef or TRefArray - if (strncmp(fTypeName.Data(),"TRef",4) != 0) return 0; - + //check if element is a TRef or TRefArray; or if it inherits from them and class was preloaded + const TString clName = ExtractClassName(fTypeName); + TClass* const type = TClass::GetClass(clName, kFALSE, kTRUE); // do NOT update fClassObject via GetClassPointer ! and do NOT call GetClass with load=true, otherwise you'll get several failing roottests. Do NOT call TRef::Class() or TRefArray::Class() either + if (clName != "TRef" && clName != "TRefArray" && (!type || !(type->InheritsFrom(TClass::GetClass("TRef", kFALSE, kTRUE)) || type->InheritsFrom(TClass::GetClass("TRefArray", kFALSE, kTRUE))))) return 0; + //if the UniqueID of this element has already been set, we assume //that it contains the exec id of a TRef object. if (GetUniqueID()) return GetUniqueID();