Skip to content

Commit 6a98298

Browse files
pcanaldpiparo
authored andcommitted
[io] Delete unused std::pair StreamerInfo.
In the case when we need a TStreamerInfo for a pair and: * There is no dictionary for that pair * There is not yet a TClass created for that pair * There is interpreter information about that pair Then the interpreter information takes precedence over the one `TStreamerInfo::GenerateInfoForPair` is generating and thus the one being generated need to be deleted. This fixes #18343
1 parent 031f6bd commit 6a98298

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

io/io/src/TStreamerInfo.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6034,6 +6034,15 @@ TVirtualStreamerInfo *TStreamerInfo::GenerateInfoForPair(const std::string &firs
60346034
gErrorIgnoreLevel = kError;
60356035
i->BuildCheck(nullptr, kFALSE); // Skipping the loading part (it would leads to infinite recursion on this very routine)
60366036
gErrorIgnoreLevel = oldlevel;
6037+
if (i->TestBit(kCanDelete)) {
6038+
// The StreamerInfo was deemed to be a duplicated (most likely case is
6039+
// that we have the interpreter information already loaded for the
6040+
// pair), so we need to delete it and return the one we already have.
6041+
auto cl = i->GetClass();
6042+
delete i;
6043+
return cl->GetStreamerInfo();
6044+
}
6045+
60376046
// In the state emulated, BuildOld would recalculate the offset and undo the offset update.
60386047
// Note: we should consider adding a new state just for this (the hints indicates that we are mapping a compiled class but
60396048
// then we would have to investigate all use of the state with <= and >= condition to make sure they are still appropriate).

0 commit comments

Comments
 (0)