Skip to content

better memory management in Geo2G4Svc

Miha Muskinja requested to merge mmuskinj/athena:21.0-Geo2G4-memory into 21.0

Aims to address a memory leak spotted by valgrind:

==178886== 954,008 (18,616 direct, 935,392 indirect) bytes in 179 blocks are definitely lost in loss record 55,963 of 56,023
==178886== at 0x4C2808C: operator new(unsigned long) (vg_replace_malloc.c:333)
==178886== by 0x2FB56303: Geo2G4AssemblyFactory::Build(GeoPVConstLink, bool&) const (in /cvmfs/

Removes static initializations of AssemblyFactory and further static map in Geo2G4AssemblyFactory.cxx.

An AssemblyFactory is now a member object of Geo2G4Svc. Some functions could no longer be const because Geo2G4AssemblyFactory::Build modifies the member map. Before this was possible because the map was not a member object but rather a static object.

Edited by Miha Muskinja

Merge request reports