Index: ash/wm/frame_painter.cc |
diff --git a/ash/wm/frame_painter.cc b/ash/wm/frame_painter.cc |
index 1f77072d27f66c061ee5cba39fb61d2431b2fd6a..03bfe26472bda1edbec023b873e4ff755cc4551c 100644 |
--- a/ash/wm/frame_painter.cc |
+++ b/ash/wm/frame_painter.cc |
@@ -147,8 +147,15 @@ FramePainter::FramePainter() |
FramePainter::~FramePainter() { |
// Sometimes we are destroyed before the window closes, so ensure we clean up. |
- if (window_) |
+ if (window_) { |
+ aura::RootWindow* root = window_->GetRootWindow(); |
+ if (root && |
+ root->GetProperty(internal::kSoloWindowFramePainterKey) == this) { |
+ root->SetProperty(internal::kSoloWindowFramePainterKey, |
+ static_cast<FramePainter*>(NULL)); |
+ } |
window_->RemoveObserver(this); |
+ } |
instances_->erase(this); |
} |
@@ -755,12 +762,16 @@ void FramePainter::UpdateSoloWindowFramePainter( |
internal::kSoloWindowFramePainterKey); |
FramePainter* new_solo_painter = GetSoloPainterInRoot(ignorable_window); |
if (old_solo_painter != new_solo_painter) { |
- if (old_solo_painter) |
+ if (old_solo_painter && old_solo_painter->frame_ && |
+ old_solo_painter->frame_->non_client_view()) { |
old_solo_painter->frame_->non_client_view()->SchedulePaint(); |
+ } |
window_->GetRootWindow()->SetProperty( |
internal::kSoloWindowFramePainterKey, new_solo_painter); |
- if (new_solo_painter) |
+ if (new_solo_painter && new_solo_painter->frame_ && |
+ new_solo_painter->frame_->non_client_view()) { |
new_solo_painter->frame_->non_client_view()->SchedulePaint(); |
+ } |
} |
} |