File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 99 * For the list of contributors see $ROOTSYS/README/CREDITS. *
1010 *************************************************************************/
1111
12- // ////////////////////////////////////////////////////////////////////////
13- // //
14- // //
15- // ////////////////////////////////////////////////////////////////////////
16-
17-
1812#include " TROOT.h"
1913#include " TStreamerElement.h"
2014#include " TVirtualStreamerInfo.h"
@@ -308,8 +302,15 @@ TClass *TStreamerElement::GetClassPointer() const
308302
309303Int_t TStreamerElement::GetExecID () const
310304{
311- // check if element is a TRef or TRefArray
312- if (strncmp (fTypeName .Data ()," TRef" ,4 ) != 0 ) return 0 ;
305+ TString typeName = fTypeName ;
306+ if (typeName != " TRef" && typeName != " TRefArray" ) {
307+ // It's not a ROOT standard TRef or TRefArray class, but it could be a user class
308+ // inheriting from it (see ROOT-7052)
309+ const TString clName = ExtractClassName (fTypeName );
310+ const auto cl = TClass::GetClass (clName, kFALSE , kTRUE );
311+ if (!cl || (nullptr == cl->GetBaseClass (" TRef" ) && nullptr == cl->GetBaseClass (" TRefArray" )))
312+ return 0 ;
313+ }
313314
314315 // if the UniqueID of this element has already been set, we assume
315316 // that it contains the exec id of a TRef object.
You can’t perform that action at this time.
0 commit comments