Skip to content

Commit

Permalink
Fix crash on NetworkScreen when corresponding view was deleted.
Browse files Browse the repository at this point in the history
BUG=crosbug.com/3757
TEST=none

Review URL: http://codereview.chromium.org/2575001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48827 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dpolukhin@chromium.org committed Jun 3, 2010
1 parent 263f8f7 commit f4badfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chrome/browser/chromeos/login/network_screen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ NetworkScreen::NetworkScreen(WizardScreenDelegate* delegate, bool is_out_of_box)
}

NetworkScreen::~NetworkScreen() {
connection_timer_.Stop();
UnsubscribeNetworkNotification();
}

Expand Down Expand Up @@ -109,6 +110,9 @@ void NetworkScreen::ButtonPressed(views::Button* sender,
// NetworkLibrary::Observer implementation:

void NetworkScreen::NetworkChanged(NetworkLibrary* network_lib) {
if (!view())
return;

// Save network selection in case it would be available after refresh.
NetworkList::NetworkType network_type = NetworkList::NETWORK_EMPTY;
string16 network_id;
Expand Down Expand Up @@ -205,6 +209,9 @@ void NetworkScreen::UnsubscribeNetworkNotification() {
}

NetworkList::NetworkItem* NetworkScreen::GetSelectedNetwork() {
if (!view())
return NULL;

return networks_.GetNetworkAt(view()->GetSelectedNetworkItem() - 1);
}

Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/chromeos/login/network_selection_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ NetworkSelectionView::NetworkSelectionView(NetworkScreenDelegate* delegate)
}

NetworkSelectionView::~NetworkSelectionView() {
network_combobox_->set_listener(NULL);
network_combobox_ = NULL;
throbber_->Stop();
throbber_ = NULL;
}

void NetworkSelectionView::Init() {
Expand Down

0 comments on commit f4badfb

Please sign in to comment.