Skip to content
Snippets Groups Projects
Commit 07575bff authored by David Blyth's avatar David Blyth Committed by MarkusFrankATcernch
Browse files

DDG4: Geant4Handle: fixed unhandled reference to shared actions

This addresses issue #376.  Previously, the initial m_refCount=1 was not
being accounted for

Also, this commit removes unnecessary readoption of the Geant4Actions
parent cc7b5b5f
No related branches found
No related tags found
No related merge requests found
......@@ -116,11 +116,14 @@ namespace dd4hep {
_ST* object = (_ST*)_create_object<TYPE>(kernel,s_type);
CONT& container = (k.*pmf)();
TYPE* value = 0;
// Need to protect the global action sequence!
G4AutoLock protection_lock(&creation_mutex); {
{ // Need to protect the global action sequence!
G4AutoLock protection_lock(&creation_mutex);
value = container.get(typ.second);
if ( !value ) value = _create_object<TYPE>(k,typ);
container.adopt(value);
if ( !value ) {
value = _create_object<TYPE>(k,typ);
container.adopt(value);
value->release();
}
}
object->use(value);
value->info("+++ Created shared object for %s of type %s.",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment