At GateVoxelSource.cpp:45
ll.fSPS->SetPosGenerator(fVoxelPositionGenerator);
which effectively does:
void GateSingleParticleSource::SetPosGenerator(GateSPSPosDistribution *pg) {
fPositionGenerator = pg;
...
}
and in GateSingleParticleSource's destructor there is
delete fPositionGenerator;
So if the GateSingleParticleSource's destructor is called in worker thread (luckily or not, it isn't right now), a double free will occur. Solution is of course putting fVoxelPositionGenerator into a G4Cache. Of course there is also a bit of memory leak here, but I think that's not a very big deal.
At GateVoxelSource.cpp:45
which effectively does:
and in GateSingleParticleSource's destructor there is
So if the GateSingleParticleSource's destructor is called in worker thread (luckily or not, it isn't right now), a double free will occur. Solution is of course putting fVoxelPositionGenerator into a G4Cache. Of course there is also a bit of memory leak here, but I think that's not a very big deal.