Index: third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
index 88ba74565b4c8961e920dd91f3fc55af2e000ec8..444e796189cb4eaa879abe371b86e5cc018444f1 100644 |
--- a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
+++ b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
@@ -145,6 +145,14 @@ void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) |
// Oilpan: as RemoteFrameView performs no finalization actions, |
// no explicit dispose() of it needed here. (cf. FrameView::dispose().) |
m_view = view; |
+ |
+ // ... the RemoteDOMWindow will need to be informed of detachment, |
+ // as otherwise it will keep a strong reference back to this RemoteFrame. |
+ // That combined with wrappers (owned and kept alive by RemoteFrame) keeping |
+ // persistent strong references to RemoteDOMWindow will prevent the GCing |
+ // of all these objects. Break the cycle by notifying of detachment. |
+ if (!m_view) |
+ m_domWindow->frameDetached(); |
} |
void RemoteFrame::createView() |