Skip to content

Commit

Permalink
WebView: Close top-level browsing context when the WebView is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Sep 21, 2022
1 parent 4d71a22 commit 467f521
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PageClientLadybird.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ PageClientLadybird::PageClientLadybird(WebView& view)
{
}

PageClientLadybird::~PageClientLadybird()
{
m_page->top_level_browsing_context().close();
}

Web::Layout::InitialContainingBlock* PageClientLadybird::layout_root()
{
auto* document = page().top_level_browsing_context().active_document();
Expand Down
1 change: 1 addition & 0 deletions PageClientLadybird.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Ladybird {
class PageClientLadybird final : public Web::PageClient {
public:
static NonnullOwnPtr<PageClientLadybird> create(WebView&);
virtual ~PageClientLadybird() override;

Web::Page& page() { return *m_page; }
Web::Page const& page() const { return *m_page; }
Expand Down

0 comments on commit 467f521

Please sign in to comment.