| Summary: | G4MassGeometrySampler destructor calls already deallocated memory, segmentation failure | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | mmarino |
| Component: | processes/transportation | Assignee: | alexander.howard |
| Status: | CLOSED REMIND | ||
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 7.1 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
mmarino
2005-10-12 20:55:19 CEST
problem occurs because the mass geometry sampler destructor does not get called
into it goes out of scope - program exits. As the runManager has already
deleted the processes this causes the segmentation fault. The fix is as follows:
Add the line:
mgs.ClearSampling()
delete runManager;
before the
return 0;
at the end of the main program and everything closes properly.
The reason the particle table is not checked before deleting a process is that
processes are attached to particles, therefore to delete an abstract process
with no particle is meaningless.
I hope this also fixes the user's application code.
|