Skip to content
Snippets Groups Projects
Commit 9835be3f authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Add Whit's patch to fix dd4hep particle refcount underflow issue for now

parent 8016ecfe
No related branches found
No related tags found
1 merge request!215Add Whit's patch to fix dd4hep particle refcount underflow issue for now
......@@ -51,6 +51,9 @@ class Dd4hep(CMakePackage):
# See https://github.com/spack/spack/issues/24232
patch('cmake_language.patch', when='@:1.16.1')
# hack to fix refcount underflow
patch('refcount_underflow.patch', when='@1.17:')
# custom hash for the 2021-07-27 version, needed to include
# https://github.com/AIDASoft/DD4hep/pull/849
# https://github.com/AIDASoft/DD4hep/pull/851
......
diff --git a/DDG4/src/Geant4Particle.cpp b/DDG4/src/Geant4Particle.cpp
index 1db6105c..7f8d7482 100644
--- a/DDG4/src/Geant4Particle.cpp
+++ b/DDG4/src/Geant4Particle.cpp
@@ -57,7 +57,9 @@ Geant4Particle::~Geant4Particle() {
void Geant4Particle::release() {
//::printf("************ Release Geant4Particle[%p]: ID:%d pdgID %d ref:%d\n",(void*)this,id,pdgID,ref-1);
if ( --ref <= 0 ) {
+ if( (ref > -1) ) {
delete this;
+ }
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment