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