Skip to content

Commit c462d3d

Browse files
committed
[core] Propagate implicit object ownership settings to TDirectory.
1 parent 0660148 commit c462d3d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

core/base/src/TDirectory.cxx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,22 @@ TDirectory::TContext::~TContext()
178178
/// ~~~ {.cpp}
179179
/// TDirectory::AddDirectory
180180
/// ~~~
181+
/// \note When ROOT::Experimental::IsImplicitObjectOwnershipEnabled() is off, these settings
182+
/// are without effect.
181183

182184
void TDirectory::AddDirectory(Bool_t add)
183185
{
184186
fgAddDirectory = add;
185187
}
186188

187189
////////////////////////////////////////////////////////////////////////////////
188-
/// Static function: see TDirectory::AddDirectory for more comments.
189-
190+
/// Check whether objects such as histograms or TGraphs2D should be owned by the current directory.
191+
/// \copydetails AddDirectory(Bool_t)
192+
/// \note ROOT::Experimental::IsImplicitObjectOwnershipEnabled() might lead to this
193+
/// setting being always off, since it has higher precedence.
190194
Bool_t TDirectory::AddDirectoryStatus()
191195
{
192-
return fgAddDirectory;
196+
return ROOT::Experimental::IsImplicitObjectOwnershipEnabled() && fgAddDirectory;
193197
}
194198

195199
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)