SharedBuffer: fix nullptr dereference on seal

If the buffer hadn't been used by all participants yet, there wouldn't
be a region, which leads to bad things.
This commit is contained in:
Robin Burchell 2019-07-16 15:06:34 +02:00 committed by Andreas Kling
parent 7bf420d83d
commit d53e54f8bf

View file

@ -2479,8 +2479,10 @@ public:
LOCKER(m_refs.lock());
m_writable = false;
for (auto& ref : m_refs.resource()) {
ref.region->set_writable(false);
MM.remap_region(*ref.region->page_directory(), *ref.region);
if (ref.region) {
ref.region->set_writable(false);
MM.remap_region(*ref.region->page_directory(), *ref.region);
}
}
}