From 411426535f50d23511e1b7c9da1412e28cd6ebfa Mon Sep 17 00:00:00 2001 From: Markus Frank Date: Sat, 25 Jan 2025 01:50:30 +0100 Subject: [PATCH] Have better validity checks of the Geant4VolumeManager when checking volume id --- DDG4/src/Geant4VolumeManager.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/DDG4/src/Geant4VolumeManager.cpp b/DDG4/src/Geant4VolumeManager.cpp index 03f505d56..65f2b6b0f 100644 --- a/DDG4/src/Geant4VolumeManager.cpp +++ b/DDG4/src/Geant4VolumeManager.cpp @@ -30,7 +30,7 @@ // C/C++ include files #include -#define VOLMGR_HAVE_DEBUG_INFO 1 +//#define VOLMGR_HAVE_DEBUG_INFO 1 #ifdef VOLMGR_HAVE_DEBUG_INFO /// Namespace for the AIDA detector description toolkit @@ -84,7 +84,16 @@ namespace { } #endif } - + /// Default destructor + ~Populator() { +#ifdef VOLMGR_HAVE_DEBUG_INFO + if ( g.g4DebugInfo ) { + delete g.g4DebugInfo; + g.g4DebugInfo = nullptr; + } +#endif + } + typedef std::pair Encoding; /// Compute the encoding for a set of VolIDs within a readout descriptor static Encoding encoding(const IDDescriptor iddesc, const PlacedVolume::VolIDs& ids) {