Message: Re: where are process objects deleted? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Re: where are process objects deleted? 

Keywords: process destruction memory
Forum: Run Management
Re: None where are process objects deleted? (Gumplinger Peter)
Date: 21 Jun, 2005
From: Götz Ruprecht <Götz Ruprecht>

It seems they are never deleted. In my PhysicsList destructor I added the following code now:

 #include "G4ProcessTable.hh"

MyPhysicsList::~MyPhysicsList() {
    G4ProcessVector *processes = G4ProcessTable::GetProcessTable()->FindProcesses();
    if (processes) {
        G4int n = processes->entries();
        for (G4int i=0; i<n; i++) {
            delete (*processes)[i];
            }
        delete processes;
    }
}

This deletes all processes. There is no runtime error, therefore I suppose the processes are deleted only once. You can't use the code from G4ProcessTable (w/o the uncommented line) because the GetProcess() method is protected.

cheers

Götz

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

 Add Message Add Message
to: "Re: where are process objects deleted?"

 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 ]