Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing] Delete the object held by gROOT after we reset the globals. #186

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions core/base/src/TROOT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1129,11 +1129,13 @@ namespace {

void TROOT::CloseFiles()
{
// Close files without deleting the objects (`ResetGlobals` will be called
// next; see `EndOfProcessCleanups()` below.)
if (fFiles && fFiles->First()) {
R__ListSlowClose(static_cast<TList*>(fFiles));
}
// and Close TROOT itself.
Close("slow");
Close("nodelete");
// Now sockets.
if (fSockets && fSockets->First()) {
if (nullptr==fCleanups->FindObject(fSockets) ) {
Expand Down Expand Up @@ -1212,14 +1214,17 @@ void TROOT::EndOfProcessCleanups()
CloseFiles();

if (gInterpreter) {
// This might delete some of the objects 'held' by the TFiles (hence
// `CloseFiles` must not delete them)
gInterpreter->ResetGlobals();
}

// Now delete the objects 'held' by the TFiles so that it
// Now delete the objects still 'held' by the TFiles so that it
// is done before the tear down of the libraries.
if (fClosedObjects && fClosedObjects->First()) {
R__ListSlowDeleteContent(static_cast<TList*>(fClosedObjects));
}
fList->Delete("slow");

// Now a set of simpler things to delete. See the same ordering in
// TROOT::~TROOT
Expand Down