From 0e738ab6aa15ecede91fac845d8da84ffad8243c Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Mon, 8 Jun 2015 12:41:31 -0700 Subject: [PATCH] Make SkyShell stop crashing on scroll in Stocks2. This is just another hack on top of the hack that is LayoutRoot. We will want to untangle Document ownership further as we iterate on LayoutRoot. For now LayoutRoot is both very inefficient (allocates a new Frame for each one!) as well as crashy like this (by not actually owning the document but rather grabbing it off the "rootElement" assigned to it). This at least fixes this common crasher for now. https://github.com/domokit/mojo/issues/206 R=abarth@chromium.org Review URL: https://codereview.chromium.org/1171643002 --- engine/core/painting/LayoutRoot.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/core/painting/LayoutRoot.cpp b/engine/core/painting/LayoutRoot.cpp index a2eedc4ea9..c3ab733308 100644 --- a/engine/core/painting/LayoutRoot.cpp +++ b/engine/core/painting/LayoutRoot.cpp @@ -37,6 +37,8 @@ LayoutRoot::LayoutRoot() LayoutRoot::~LayoutRoot() { + if (!m_document->needsAttach()) + m_document->detach(); } Element* LayoutRoot::rootElement() const -- GitLab