Skip to content
Snippets Groups Projects
Commit df56f087 authored by Scott Snyder's avatar Scott Snyder Committed by Frank Winklmeier
Browse files

SGTools: Move static variable out-of-line.

SGTools: Move static variable out-of-line.

Move the empty string variable used in TransientAddress::name()
from being defined in that inlined method to a static class member
which is instead defined out-of-line.

Avoids crashes seen related to library loading ordering when compiled with LTO.
parent be9a6299
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SGTOOLS_TRANSIENTADDRESS_H
......@@ -175,6 +175,8 @@ namespace SG {
///< all alias names for a DataObject. They come from setAlias
TransientAliasSet m_transientAlias;
static const std::string s_emptyString;
};
/////////////////////////////////////////////////////////////////////
// inlined code:
......@@ -212,8 +214,7 @@ namespace SG {
if (m_name.isValid()) {
return *m_name.ptr();
}
static const std::string empty;
return empty;
return s_emptyString;
}
/// Get the primary (hashed) SG key.
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#include "SGTools/TransientAddress.h"
......@@ -12,6 +12,8 @@
using SG::TransientAddress;
const std::string TransientAddress::s_emptyString;
// Default Constructor:
TransientAddress::TransientAddress()
: TransientAddress (CLID_NULL, "", nullptr, true, false)
......
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