I ran valgrind on my program to find a memory leak and stumbled upon this message warning of a a lost block in G4VisManager.cc ==19658== 362 (192 direct, 170 indirect) bytes in 1 blocks are definitely lost in loss record 28,528 of 28,838 ==19658== at 0x4C2C7A7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==19658== by 0x604FB3F: G4VisManager::RegisterMessengers() (G4VisManager.cc:437) ==19658== by 0x604EEA0: G4VisManager::Initialise() (G4VisManager.cc:310) ==19658== by 0x43978B: G4VisManager::Initialize() (G4VisManager.icc:33) ==19658== by 0x438789: main (K37.cc:162) Looking at the relevant piece of code in G4VisManager.cc with some context 436 437 directory = new G4UIdirectory ("/vis/touchable/"); 438 directory -> SetGuidance ("Operations on touchables."); 439 directory = new G4UIdirectory ("/vis/touchable/set/"); 440 directory -> SetGuidance ("Set vis attributes of current touchable."); 441 fDirectoryList.push_back (directory); 442 RegisterMessenger(new G4VisCommandsTouchableSet); 443 444 directory = new G4UIdirectory ("/vis/viewer/"); 445 directory -> SetGuidance ("Operations on Geant4 viewers."); 446 fDirectoryList.push_back (directory); It looks like there should be a call to fDirectoryList.push_back (directory); added between the current lines 438 and 439 because the fDirectoryList is what is responsible for calling the delete operator in the destructor.
Thanks for this. An oversight. mea culpa. It will be fixed in the next release.