Problem 692 - The destructor of G4HadronicInteractionRegistry might become impossible to finish.
Summary: The destructor of G4HadronicInteractionRegistry might become impossible to fi...
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/models (show other problems)
Version: 6.2
Hardware: Other Other
: P2 normal
Assignee: Hans-Peter.Wellisch
URL:
Depends on:
Blocks:
 
Reported: 2004-11-19 17:53 CET by tkoi
Modified: 2005-02-22 04:27 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description tkoi 2004-11-19 17:53:42 CET
If a size of allModels is not 0, the while loop in the destructor becomes an
infinite loop.

 46 G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry()
 47 {
 48   while(allModels.size()!=0)
 49   {
 50     delete allModels.front();
 51   }
 52 }
Is this correct?
or
 48   while(allModels.size()!=0)
 49   {
 50     allModels.erase( allModels.begin() );
 51   }
is a correct implementation what you want to do?

Tatsumi
Comment 1 Hans-Peter.Wellisch 2005-02-22 04:24:59 CET
Hi Tatsumi,

  I am stunned. The code you show me should result on a loop in every single
job. I'll have to find out, why this is not the case...

Regards,

Hans-Peter.
Comment 2 Hans-Peter.Wellisch 2005-02-22 04:27:59 CET
Hi Tatsumi,

  I checked, and found that it is ok. The code as it is gives the desired
behavior.

Many greetings,

Hans-Peter.