mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Shm::Monitor: add nullptr check for segment info
This commit is contained in:
parent
69faa63c5b
commit
d3ae8df55f
|
@ -660,6 +660,8 @@ void Monitor::ResetContent(const ShmId& shmIdT, bool verbose /* = true */)
|
|||
managed_shared_memory managementSegment(open_only, managementSegmentName.c_str());
|
||||
|
||||
Uint16SegmentInfoHashMap* segmentInfos = managementSegment.find<Uint16SegmentInfoHashMap>(unique_instance).first;
|
||||
if (segmentInfos) {
|
||||
cout << "Found info for " << segmentInfos->size() << " managed segments" << endl;
|
||||
for (const auto& s : *segmentInfos) {
|
||||
if (verbose) {
|
||||
cout << "Resetting content of segment '" << "fmq_" << shmId << "_m_" << s.first << "'..." << endl;
|
||||
|
@ -682,6 +684,9 @@ void Monitor::ResetContent(const ShmId& shmIdT, bool verbose /* = true */)
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cout << "Found management segment, but cannot locate segment info, something went wrong..." << endl;
|
||||
}
|
||||
|
||||
Uint16RegionInfoHashMap* shmRegions = managementSegment.find<Uint16RegionInfoHashMap>(bipc::unique_instance).first;
|
||||
if (shmRegions) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user