Skip to content

Commit ef7eb8d

Browse files
committed
[tree] Honour ObjectAutoRegistrationEnabled() in TEventList.
1 parent 2d2899a commit ef7eb8d

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

core/base/src/TROOT.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ namespace Internal {
728728
/// | TEfficiency | Yes | No |
729729
/// | TProfile2D | Yes | TH1::AddDirectoryStatus() |
730730
/// | TEntryList | No, but planned for 6.42 | No |
731-
/// | TEventList | No, but planned for 6.42 | No |
731+
/// | TEventList | Yes | No |
732732
/// | TFunction | No, but work in progress | No |
733733
///
734734
/// ## Setting defaults

tree/tree/src/TEventList.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ the TEventList object created in the above commands:
5252
#include "TDirectory.h"
5353
#include "TCollection.h"
5454
#include "TMathBase.h"
55+
#include "TROOT.h"
5556

5657
////////////////////////////////////////////////////////////////////////////////
5758
/// Create a EventList.
@@ -65,8 +66,11 @@ TEventList::TEventList(const char *name, const char *title, Int_t initsize, Int_
6566
if (delta > 100) fDelta = delta;
6667
else fDelta = 100;
6768
fList = nullptr;
68-
fDirectory = gDirectory;
69-
if (fDirectory) fDirectory->Append(this);
69+
if (ROOT::Experimental::ObjectAutoRegistrationEnabled()) {
70+
fDirectory = gDirectory;
71+
if (fDirectory)
72+
fDirectory->Append(this);
73+
}
7074
}
7175

7276
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)