Description
The problem appears for RecursiveRemove'd trees as well as trees owned by TChains.
First observed in ROOT-9281.
Minimal reproducer (the tree clone is only introduced to trigger a crash):
#include <TTree.h>
|
#include <iostream>
|
|
int main() |
{
|
auto tree = new TTree("t", "t"); |
auto friendTree = new TTree("s", "s"); |
tree->AddFriend(friendTree);
|
TTree cloneTree("q", "q"); |
tree->AddClone(&cloneTree);
|
int x; |
cloneTree.Branch("x", &x); |
|
delete friendTree; |
// prints 1 although the friend is already deleted |
std::cout << tree->GetListOfFriends()->GetEntries() << std::endl;
|
// crashes trying to access the contents of the friend TTree |
delete tree; |
return 0; |
}
|