diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-10 23:49:42 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-10 23:49:42 +0000 |
commit | 931f4f459b8c02df475270847ab988a845b33611 (patch) | |
tree | 83e0c8859fa163a74f6253c204d8f7acece36e52 /ash/shell.cc | |
parent | 32b1640238c621ac9153711c644446b48afe410f (diff) | |
download | chromium_src-931f4f459b8c02df475270847ab988a845b33611.zip chromium_src-931f4f459b8c02df475270847ab988a845b33611.tar.gz chromium_src-931f4f459b8c02df475270847ab988a845b33611.tar.bz2 |
aura: Fix crash on closing host window.
- Make Launcher owns its widget;
- Update Shell's dtor since we no longer need to explicitly release launcher;
Also removed explicit tooltip_controller_.reset() and let scoped_ptr handle its release.
BUG=113466,104672
TEST=Verify crash in issue 113466 no longer happens and ASAN failure in 104672 does not regress.
Review URL: http://codereview.chromium.org/9369061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121571 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell.cc')
-rw-r--r-- | ash/shell.cc | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index 92272d4..6874ca0 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -223,36 +223,22 @@ Shell::~Shell() { // widget gets deleted in the final message loop run. root_window_layout_->SetBackgroundWidget(NULL); - // TooltipController needs a valid shell instance. We delete it before - // deleting the shell |instance_|. + // TooltipController is deleted with the Shell so removing its references. RemoveRootWindowEventFilter(tooltip_controller_.get()); aura::client::SetTooltipClient(NULL); - // The LayoutManagers for the default and status containers talk to - // ShelfLayoutManager (LayoutManager installed on the launcher container). - // ShelfLayoutManager has a reference to the launcher widget. To avoid any of - // these trying to reference launcher after it's deleted we delete them all, - // then the launcher. - if (window_mode_ != MODE_MANAGED) - ResetLayoutManager(internal::kShellWindowId_DefaultContainer); - ResetLayoutManager(internal::kShellWindowId_StatusContainer); - ResetLayoutManager(internal::kShellWindowId_LauncherContainer); // Make sure we delete WorkspaceController before launcher is // deleted as it has a reference to launcher model. workspace_controller_.reset(); - launcher_.reset(); // Delete containers now so that child windows does not access - // observers when they are destructed. This has to be after launcher - // is destructed because launcher closes the widget in its destructor. + // observers when they are destructed. aura::RootWindow* root_window = aura::RootWindow::GetInstance(); while (!root_window->children().empty()) { aura::Window* child = root_window->children()[0]; delete child; } - tooltip_controller_.reset(); - // These need a valid Shell instance to clean up properly, so explicitly // delete them before invalidating the instance. drag_drop_controller_.reset(); |