| Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
| index 2c1032aecb501ccaef1f27cde55e16e3374f9b11..25f6339b811b44038a1aff4516419c6fb60506d7 100644
|
| --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
| @@ -398,6 +398,8 @@ void LocalFrame::detach(FrameDetachType type) {
|
| // frame on a detached DOM tree, which is bad.
|
| SubframeLoadingDisabler disabler(*document());
|
| m_loader.dispatchUnloadEvent();
|
| + if (!client())
|
| + return;
|
| detachChildren();
|
|
|
| // All done if detaching the subframes brought about a detach of this frame
|
| @@ -485,7 +487,7 @@ bool LocalFrame::shouldClose() {
|
| }
|
|
|
| void LocalFrame::detachChildren() {
|
| - DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document());
|
| + CHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document());
|
|
|
| if (Document* document = this->document())
|
| ChildFrameDisconnector(*document).disconnect();
|
|
|