Skip to content

Commit

Permalink
FairRun: Remove fTask from Browsables
Browse files Browse the repository at this point in the history
FairRunAna might add fTask to ROOT's "ListOfBrowsables".
FairRun deallocates it during its desctructor.
So let's remove it from the list there as well.

(cherry picked from commit f9f1648)
  • Loading branch information
ChristianTackeGSI authored and dennisklein committed Nov 14, 2022
1 parent ff0af3d commit f6928ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion base/steer/FairRun.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#endif
#include <TList.h> // for TList
#include <TObject.h> // for TObject
#include <TROOT.h> // fot gROOT
#include <cassert> // for... well, assert

TMCThreadLocal FairRun* FairRun::fRunInstance = 0;
Expand Down Expand Up @@ -85,7 +86,11 @@ FairRun::FairRun(Bool_t isMaster)
FairRun::~FairRun()
{
LOG(debug) << "Enter Destructor of FairRun";
delete fTask; // There is another tasklist in MCApplication,
if (fTask) {
// FairRunAna added it, but let's remove it here, because we own it
gROOT->GetListOfBrowsables()->Remove(fTask);
delete fTask; // There is another tasklist in MCApplication,
}
// but this should be independent
delete fRtdb; // who is responsible for the RuntimeDataBase
delete fEvtHeader;
Expand Down

0 comments on commit f6928ee

Please sign in to comment.