Skip to content
Snippets Groups Projects
Commit d5bad7b4 authored by Philippe Canal's avatar Philippe Canal
Browse files

From Paul Russo:

     o Cloned trees should not have ownership
       of branch-allocated objects.


git-svn-id: http://root.cern.ch/svn/root/trunk@15794 27541ba8-7e3a-0410-8455-c3a389f83636
parent 29f28b6e
No related branches found
No related tags found
No related merge requests found
// @(#)root/treeplayer:$Name: $:$Id: TTreePlayer.cxx,v 1.220 2006/07/05 17:29:05 pcanal Exp $
// @(#)root/treeplayer:$Name: $:$Id: TTreePlayer.cxx,v 1.221 2006/07/06 08:29:46 brun Exp $
// Author: Rene Brun 12/01/96
/*************************************************************************
......@@ -371,6 +371,16 @@ TTree *TTreePlayer::CopyTree(const char *selection, Option_t *, Long64_t nentrie
TTree *tree = fTree->CloneTree(0);
if (tree == 0) return 0;
// The clone should not delete any shared i/o buffers.
TObjArray* branches = tree->GetListOfBranches();
Int_t nb = branches->GetEntriesFast();
for (Int_t i = 0; i < nb; ++i) {
TBranch* br = (TBranch*) branches->UncheckedAt(i);
if (br->InheritsFrom("TBranchElement")) {
((TBranchElement*) br)->ResetDeleteObject();
}
}
Long64_t entry,entryNumber;
nentries = GetEntriesToProcess(firstentry, nentries);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment