Commit d4bef811 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

aura: explicitly delete WindowPort in destructor

This way the WindowPort can reach back into the Window during destruction.

BUG=847992
TEST=covered by tests

Change-Id: I70df1c9512086f9e834ab76fa430c94f5723f34d
Reviewed-on: https://chromium-review.googlesource.com/1175133Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583163}
parent 22e3b786
...@@ -93,9 +93,6 @@ Window::Window(WindowDelegate* delegate, ...@@ -93,9 +93,6 @@ Window::Window(WindowDelegate* delegate,
Window::~Window() { Window::~Window() {
WindowOcclusionTracker::ScopedPauseOcclusionTracking pause_occlusion_tracking; WindowOcclusionTracker::ScopedPauseOcclusionTracking pause_occlusion_tracking;
// See comment in header as to why this is done.
std::unique_ptr<WindowPort> port = std::move(port_owner_);
if (layer()->owner() == this) if (layer()->owner() == this)
layer()->CompleteAllAnimations(); layer()->CompleteAllAnimations();
layer()->SuppressPaint(); layer()->SuppressPaint();
...@@ -154,6 +151,11 @@ Window::~Window() { ...@@ -154,6 +151,11 @@ Window::~Window() {
// acquired it. // acquired it.
layer()->set_delegate(NULL); layer()->set_delegate(NULL);
DestroyLayer(); DestroyLayer();
// Delete the WindowPort now, in case it needs to reach back into the Window
// during destruction.
port_owner_.reset();
port_ = nullptr;
} }
void Window::Init(ui::LayerType layer_type) { void Window::Init(ui::LayerType layer_type) {
......
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