Commit 66dfcf57 authored by sadrul@chromium.org's avatar sadrul@chromium.org

ash uber tray: Fix a couple of crashes when quitting.

BUG=110130
TEST=none

Review URL: https://chromiumcodereview.appspot.com/9583001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124669 0039d316-1c4b-4281-b951-d872f2087c98
parent 9877c372
...@@ -81,6 +81,8 @@ SystemTray::SystemTray() ...@@ -81,6 +81,8 @@ SystemTray::SystemTray()
} }
SystemTray::~SystemTray() { SystemTray::~SystemTray() {
if (popup_)
popup_->CloseNow();
for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); for (std::vector<SystemTrayItem*>::iterator it = items_.begin();
it != items_.end(); it != items_.end();
++it) { ++it) {
......
...@@ -32,7 +32,9 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, ...@@ -32,7 +32,9 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
} }
virtual ~SystemTrayDelegate() { virtual ~SystemTrayDelegate() {
AudioHandler::GetInstance()->RemoveVolumeObserver(this); AudioHandler* audiohandler = AudioHandler::GetInstance();
if (audiohandler)
audiohandler->RemoveVolumeObserver(this);
DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
} }
......
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