| Index: content/browser/frame_host/render_frame_host_impl.cc
|
| diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
| index 4c85824121dd2d5226eca912974a63cb27227ccd..7b8eddf7eb537f4e0c6be4bef684b1631d55598d 100644
|
| --- a/content/browser/frame_host/render_frame_host_impl.cc
|
| +++ b/content/browser/frame_host/render_frame_host_impl.cc
|
| @@ -370,10 +370,15 @@ RenderFrameHostImpl::~RenderFrameHostImpl() {
|
|
|
| // If this RenderFrameHost is swapping with a RenderFrameProxyHost, the
|
| // RenderFrame will already be deleted in the renderer process. Main frame
|
| - // RenderFrames will be cleaned up as part of deleting its RenderView. In all
|
| - // other cases, the RenderFrame should be cleaned up (if it exists).
|
| - if (is_active() && !frame_tree_node_->IsMainFrame() && render_frame_created_)
|
| + // RenderFrames will be cleaned up as part of deleting its RenderView if the
|
| + // RenderView isn't in use by other frames. In all other cases, the
|
| + // RenderFrame should be cleaned up (if it exists).
|
| + bool will_render_view_clean_up_render_frame =
|
| + frame_tree_node_->IsMainFrame() && render_view_host_->ref_count() == 1;
|
| + if (is_active() && render_frame_created_ &&
|
| + !will_render_view_clean_up_render_frame) {
|
| Send(new FrameMsg_Delete(routing_id_));
|
| + }
|
|
|
| // Null out the swapout timer; in crash dumps this member will be null only if
|
| // the dtor has run. (It may also be null in tests.)
|
|
|