Skip to content

Commit a79ea41

Browse files
committed
[tree] Honour ObjectAutoRegistrationEnabled() in TEventList.
1 parent ddf02bc commit a79ea41

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tree/tree/src/TEventList.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ the TEventList object created in the above commands:
5151
#include "TCut.h"
5252
#include "TDirectory.h"
5353
#include "TMathBase.h"
54+
#include "TROOT.h"
5455

5556
////////////////////////////////////////////////////////////////////////////////
5657
/// Create a EventList.
@@ -64,8 +65,10 @@ TEventList::TEventList(const char *name, const char *title, Int_t initsize, Int_
6465
if (delta > 100) fDelta = delta;
6566
else fDelta = 100;
6667
fList = nullptr;
67-
fDirectory = gDirectory;
68-
if (fDirectory) fDirectory->Append(this);
68+
if (ROOT::Experimental::ObjectAutoRegistrationEnabled()) {
69+
fDirectory = gDirectory;
70+
if (fDirectory) fDirectory->Append(this);
71+
}
6972
}
7073

7174
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)