Message: Re: New and delete operations in detector construction examples Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: New and delete operations in detector construction examples 

Forum: Documentation and Examples
Re: None New and delete operations in detector construction examples (Ben Morgan)
Date: 10 Mar, 2005
From: Jeremy McCormick <Jeremy McCormick>

Geometry-related objects are registered into global object stores.
I believe materials, logical volumes, physical volumes, solids and regions
are all deleted when their stores are destroyed.  This happens when Geant4
itself is shutting down.  Unless you have a need to reset the geometry
and therefore clear the stores during a session, you should consider these 
objects to be "owned" by Geant4 once they are initialized using new.  In 
effect, the memory is permanently allocated until your application ends.  
I don't believe this is problemmatic, as you will generally only load one 
geometry during a given session.  You may cause some serious problems if 
you delete some of these objects before the application ends, e.g. deleting 
materials or regions could invalidate a number of pointers in Geant4 data 
structures.

--Jeremy

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: New and delete operations in detector construction examples"

 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 ]