Skip to content

Commit 0f29938

Browse files
fix: Do not leak LinkManager in FairRun
FairRun's constructor used to allocate a FairLinkManager, but the destructor did not deallocate it. Switch it over to a valued member so that default behaviour allocates and deallocates it.
1 parent bc4f4bb commit 0f29938

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

fairroot/base/steer/FairLinkManager.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/********************************************************************************
2+
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3+
* *
4+
* This software is distributed under the terms of the *
5+
* GNU Lesser General Public Licence (LGPL) version 3, *
6+
* copied verbatim in the file "LICENSE" *
7+
********************************************************************************/
18
// -------------------------------------------------------------------------
29
// ----- FairLinkManager source file -----
310
// ----- Created 05/06/14 by T.Stockmanns -----

fairroot/base/steer/FairLinkManager.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/********************************************************************************
2+
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3+
* *
4+
* This software is distributed under the terms of the *
5+
* GNU Lesser General Public Licence (LGPL) version 3, *
6+
* copied verbatim in the file "LICENSE" *
7+
********************************************************************************/
18
#ifndef FAIR_LINK_MANAGER_H
29
#define FAIR_LINK_MANAGER_H
310

fairroot/base/steer/FairRun.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "FairRun.h"
1414

1515
#include "FairFileHeader.h" // for FairFileHeader
16-
#include "FairLinkManager.h" // for FairLinkManager
1716
#include "FairLogger.h" // for FairLogger, MESSAGE_ORIGIN
1817
#include "FairRootFileSink.h" // only temporary, should be removed after the move to FairSink is finished
1918
#include "FairRootManager.h" // for FairRootManager
@@ -77,8 +76,6 @@ FairRun::FairRun(Bool_t isMaster)
7776
#endif
7877

7978
fRootManager = FairRootManager::Instance();
80-
81-
new FairLinkManager();
8279
}
8380

8481
FairRun::~FairRun()

fairroot/base/steer/FairRun.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "FairAlignmentHandler.h"
1212
#include "FairEventHeader.h"
13+
#include "FairLinkManager.h"
1314
#include "FairSink.h"
1415
#include "FairSource.h"
1516

@@ -209,6 +210,8 @@ class FairRun : public TNamed
209210
/** Number of Tasks added*/
210211
Int_t fNTasks;
211212

213+
FairLinkManager fLinkManager{}; //!
214+
212215
protected:
213216
/** static pointer to this run*/
214217
static TMCThreadLocal FairRun* fRunInstance;

0 commit comments

Comments
 (0)