We are with the ATLAS Collaboration and try to develop a common interface between a Gaudi AlgTool and a G4VSensitiveDetector class. The AlgTool provides nothing but runtime instantiation, as we would like to assign SensDets dynamically at runtime. The problem we ran into is that the G4SDManager seems to take ownership of the SDs and deletes them once the G4RunManager terminates. Now, of course, the Gaudi ToolSvc comes along and wants to do the same thing with the SD as a AlgTool component, and the second delete causes a segfault. I wonder if this isn't a very common case, other collaborations integrating G4 code into their frameworks, and if it would not be reasonable to provide a switch for keeping ownership at some places in the G4 code, probably the SDs are not the only component where this makes sense.
*** This bug has been marked as a duplicate of 451 *** *** 'Makoto.Asai@cern.ch' will be responsible for this bug. ***