diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorDesign.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorDesign.h index 52487fb58cb39771612756d8d97da61ef98b3102..293436a9b2cc304609225dd4c4a4421fa1852398 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorDesign.h +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorDesign.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -18,7 +18,6 @@ #include "CLHEP/Geometry/Vector3D.h" #include "AtlasDetDescr/AtlasDetectorID.h" #include "GeoPrimitives/GeoPrimitives.h" -#include "GeoModelKernel/RCBase.h" #include "InDetDD_Defs.h" #include @@ -52,7 +51,7 @@ enum DetectorShape { @author A. Calvet, Grant Gorfine */ -class SiDetectorDesign: public RCBase { +class SiDetectorDesign { public: enum Axis { xAxis=0, yAxis, zAxis diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorManager.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorManager.h index 4a7987ded6aa2d07bb522374124a3fd9481a0c8a..71d208dd5ab3b6e7cb67d08101d2dcac602f985e 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorManager.h +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorManager.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -64,7 +64,7 @@ class SiNumerology; SiDetectorManager(StoreGateSvc * detStore, const std::string & name); // Destructor - virtual ~SiDetectorManager() {}; + virtual ~SiDetectorManager(); // @@ -123,7 +123,7 @@ class SiNumerology; /** Access Numerology */ const SiNumerology & numerology() const {return m_numerology;} SiNumerology & numerology() {return m_numerology;} - + private: //** Prevent copy and assignment */ const SiDetectorManager & operator=(const SiDetectorManager &right); diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx index ee8437a2a1bb88b047f27bc822ed1d4f324c3af6..8b068134f6fe5bc7819710627ac20738a6c49dd4 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx @@ -59,8 +59,6 @@ namespace InDetDD { // Destructor: SiDetectorElement::~SiDetectorElement() { - // The design is reference counted so that it will not be deleted until the last element is deleted. - m_design->unref(); m_commonItems->unref(); } @@ -727,14 +725,9 @@ namespace InDetDD { if (!m_idHash.is_valid()) throw std::runtime_error("SiDetectorElement: Unable to set IdentifierHash"); - // Increase the reference count of the SiDetectorDesign objects. - m_design->ref(); - // Increase the reference count of the SiCommonItems objects. m_commonItems->ref(); - // Should we reference count the geophysvol as well? - // Set surface m_surface = std::make_unique(*this); } diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorManager.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorManager.cxx index 510baba490ab5e0201810c3503f93ac149160c98..3011a3e16d00ae24381b2856cebf60d46cad9359 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorManager.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorManager.cxx @@ -30,6 +30,13 @@ namespace InDetDD addFolder("/Indet/Align"); } + SiDetectorManager::~SiDetectorManager() + { + for (const SiDetectorDesign* design : m_designs) { + delete design; + } + } + const std::string& SiDetectorManager::tag() const { return m_tag;