Commit e0ea06e3 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

cocoa: reset observer in HungRendererController dealloc

HungRendererController autoreleases itself, which doesn't work well when it
doesn't actually hold a reference to the containing window (which it doesn't
in MacViews builds). This fixes the HungRendererController interactive UI test.

Bug: 823517
Change-Id: I5fc14faa8eeaba7b20f5e922a43d4817ca2c810a
Reviewed-on: https://chromium-review.googlesource.com/1015261Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551412}
parent 1b2a62de
......@@ -261,6 +261,13 @@ class HungRendererObserverBridge : public content::WebContentsObserver,
hungContents_ = nullptr;
hungWidget_ = nullptr;
// Reset the observer now. It is not necessarily the case that this class
// actually holds a reference to the containing BrowserWindow, and if it does
// not, the BrowserWindow's destructor can run *before* this object is cleaned
// up by the autorelease pool. This can't happen in practice, but it can
// happen in tests.
hungContentsObserver_.reset();
[self autorelease];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment