mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:07:36 +00:00
WebContent: Tolerate invalid page_ids in ConnectionFromClient
When a tab or nested traversable navigable is closed, there might be messages still in the pipe from the UI process that we need to gracefully drop, rather than crash trying to access an invalid pointer.
This commit is contained in:
parent
3d6c515bae
commit
9077fe15ac
4 changed files with 417 additions and 75 deletions
|
@ -34,6 +34,13 @@ void PageHost::remove_page(Badge<PageClient>, u64 index)
|
|||
m_pages.remove(index);
|
||||
}
|
||||
|
||||
Optional<PageClient&> PageHost::page(u64 index)
|
||||
{
|
||||
return m_pages.get(index).map([](auto& value) -> PageClient& {
|
||||
return *value;
|
||||
});
|
||||
}
|
||||
|
||||
PageHost::~PageHost() = default;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue