Skip to content

Commit

Permalink
JService::Init always called inside JApplication::Initialize()
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwbrei committed Jan 7, 2025
1 parent f4626c4 commit dbbeaa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libraries/JANA/JApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ void JApplication::Initialize() {

topology_builder->create_topology();
auto execution_engine = m_service_locator->get<JExecutionEngine>();

// Make sure that Init() is called on any remaining JServices
m_service_locator->wire_everything();

m_initialized = true;
// This needs to be at the end so that m_initialized==false while InitPlugin() is being called
}
Expand Down
1 change: 1 addition & 0 deletions src/libraries/JANA/Services/JServiceLocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class JServiceLocator {
std::lock_guard<std::mutex> lock(mutex);
auto svc = std::dynamic_pointer_cast<JService>(t);
assert(svc != nullptr);
svc->SetTypeName(JTypeInfo::demangle<T>());
underlying[std::type_index(typeid(T))] = svc;
}

Expand Down

0 comments on commit dbbeaa3

Please sign in to comment.