Dear those who are concerened in GEATN4 development, My debugging with valgrind tells that there is a memory leak in G4Navigator.icc::CreateTouchableHistory(). ==14174== 116 bytes in 1 blocks are definitely lost in loss record 168 of 269 ==14174== at 0x1B904AFB: operator new(unsigned) (vg_replace_malloc.c:133) ==14174== by 0x81F097B: G4Navigator::CreateTouchableHistory() const (G4Navigator.icc:283) ==14174== by 0x825FD58: G4Navigator::LocateGlobalPointAndUpdateTouchableHandle(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, G4ReferenceCountedHandle<G4VTouchable>&, bool) (G4Navigator.cc:521) ==14174== by 0x81CB620: G4Transportation::PostStepDoIt(G4Track const&, G4Step const&) (G4Transportation.cc:600) I cannot fully trace G4Transportation::PostStepDoIt, but seems that the private member "fCurrentTouchableHandle" is not cleared in the private menber "fParticleChange" in G4Transportation.cc. The memory leak is not critically severe, but I would like to ask you to fix it. Sincerely, Yoshinori Sato
A simple inspection shows that indeed the destructor does not clear the memory for the fCurrentTouchableHandle data member. We will correct it in the next version. Thank you and best regards, John Apostolakis
Dear John and others, Thank you for identifing the problem. Please tell me where and how to fix the memory leak in G4Transportation.cc. Is it O.K. to add "delete fCurrentTouchableHandle" in the destructor ? Sincerely, Yoshinori Sato
We have included a fix for this problem in release 8.2. Please see http://www-geant4.kek.jp/lxr/source/processes/transportation/src/G4Transportation.cc?v=8.2 Best regards, John Apostolakis