From 8f7f217f759d05f0a72fa33c4c137af9ab616b3c Mon Sep 17 00:00:00 2001 From: adrien-matta <a.matta@surrey.ac.uk> Date: Tue, 27 Oct 2015 15:12:28 +0000 Subject: [PATCH] * Fixing Linux crash with new PhysicsList --- NPSimulation/Core/PhysicsList.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/NPSimulation/Core/PhysicsList.cc b/NPSimulation/Core/PhysicsList.cc index 198231471..80304c2b4 100644 --- a/NPSimulation/Core/PhysicsList.cc +++ b/NPSimulation/Core/PhysicsList.cc @@ -110,9 +110,15 @@ PhysicsList::PhysicsList() : G4VModularPhysicsList(){ if(m_Decay){ decay_List = new G4DecayPhysics(); radioactiveDecay_List = new G4RadioactiveDecayPhysics() ; - m_PhysList.push_back( decay_List); - m_PhysList.push_back( radioactiveDecay_List); + m_PhysList.push_back(decay_List); + m_PhysList.push_back(radioactiveDecay_List); } + + else{ + decay_List = 0; + radioactiveDecay_List = 0; + } + } //////////////////////////////////////////////////////////////////////////////// @@ -152,15 +158,13 @@ void PhysicsList::ReadConfiguration(std::string filename){ m_Decay = value; else std::cout <<"WARNING: Physics List Token '" << name << "' unknown. Token is ignored." << std::endl; - - std::cout << name << " " << value << std::endl; } } ///////////////////////////////////////////////////////////////////////////// PhysicsList::~PhysicsList(){ delete emPhysicsList; m_PhysList.clear(); - for(size_t i=0; i<m_PhysList.size(); i++){ + for(size_t i=0; i < m_PhysList.size(); i++){ delete m_PhysList[i]; } } -- GitLab