Message: Re: Double deletes in ~G4Track() Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Double deletes in ~G4Track() 

Forum: Event and Track Management
Re: None Double deletes in ~G4Track() (Tom Roberts)
Re: None Re: Double deletes in ~G4Track() (Hisaya Kurashige)
Date: 19 Sep, 2012
From: Tom Roberts <Tom Roberts>

You're right, and the Geant4 code is OK here. My problem was really double deletes of G4Track, and that was in my code, not Geant4's; now fixed.

I did not look at G4Track::operator=(G4Track&) because I had seen it was hidden (made private with a comment), and thought that meant it was unimplemented. It is used in the G4Track copy constructor, and does the new G4DynamicParticle that balances the delete in ~G4Track().

Given that operator= has a real and complete implementation, why is it hidden (private with comment)? -- that is a well-known C++ idiom that normally means it is unimplemented, and is declared private merely to prevent its use. (Rhetorical question: the answer is probably buried in ancient history.)

 Add Message Add Message
to: "Re: Double deletes in ~G4Track()"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]