Skip to content

Commit f31160d

Browse files
authored
Merge pull request #2083 from kswiecicki/xpti-init-fix
Fix XPTI initialization bug
2 parents 2bbe952 + 6406879 commit f31160d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/loader/layers/tracing/ur_tracing_layer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ struct XptiContextManager {
3434
~XptiContextManager() { xptiFrameworkFinalize(); }
3535
};
3636

37-
static std::shared_ptr<XptiContextManager> xptiContextManagerGlobal = [] {
38-
return std::make_shared<XptiContextManager>();
39-
}();
37+
static std::shared_ptr<XptiContextManager> xptiContextManagerGet() {
38+
static auto contextManager = std::make_shared<XptiContextManager>();
39+
return contextManager;
40+
};
4041
static thread_local xpti_td *activeEvent;
4142

4243
///////////////////////////////////////////////////////////////////////////////
4344
context_t::context_t() : logger(logger::create_logger("tracing", true, true)) {
44-
this->xptiContextManager = xptiContextManagerGlobal;
45+
this->xptiContextManager = xptiContextManagerGet();
4546

4647
call_stream_id = xptiRegisterStream(CALL_STREAM_NAME);
4748
std::ostringstream streamv;

0 commit comments

Comments
 (0)