Problem 1648

Summary: QGSP_BERT (and other?) destructors derference tpdata without checking for null pointer
Product: Geant4 Reporter: Michael Kelsey <kelsey>
Component: physics_listsAssignee: Andrea Dotti <andrea.dotti>
Status: RESOLVED FIXED    
Severity: trivial CC: Gunter.Folger, Vladimir.Ivantchenko
Priority: P5    
Version: 10.0   
Hardware: All   
OS: All   

Description Michael Kelsey 2014-06-29 08:28:12 CEST
If an application exits from the PreInit state, the QGSP_BERT physics list causes a segfault because the G4HadronPhysicsQGSP_BERT dtor include deletion of model pointers contained in a "tpdata" object which has not yet been instantiated.  The dtor should test for (tpdata != 0) before deleting its contents.

NOTE:  I have fixed this problem in the hadron_inelastic/ physics constructors at the HEAD of the SVN repository.  Other constructors may have analogous issues with different object names.
Comment 1 Andrea Dotti 2014-07-01 23:25:08 CEST
Mike introduced fix. Verified that same strategy is not used in other constructors. 
Tag phys-ctor-hinelastic-V10-00-03 created.