Commit 4b6d62b6 authored by sadrul@chromium.org's avatar sadrul@chromium.org

ash: Fix a few leaks in the network list.

View::RemoveChildView() does not delete the child view. So make sure they
are destroyed correctly.

BUG=none
R=jennyz@chromium.org

Review URL: https://codereview.chromium.org/400983004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284140 0039d316-1c4b-4281-b951-d872f2087c98
parent f2c05bd0
...@@ -515,6 +515,7 @@ void NetworkStateListDetailedView::UpdateNetworkList() { ...@@ -515,6 +515,7 @@ void NetworkStateListDetailedView::UpdateNetworkList() {
remove_service_paths.insert(it->first); remove_service_paths.insert(it->first);
network_map_.erase(it->second); network_map_.erase(it->second);
scroll_content()->RemoveChildView(it->second); scroll_content()->RemoveChildView(it->second);
delete it->second;
needs_relayout = true; needs_relayout = true;
} }
} }
...@@ -624,6 +625,7 @@ bool NetworkStateListDetailedView::UpdateNetworkListEntries( ...@@ -624,6 +625,7 @@ bool NetworkStateListDetailedView::UpdateNetworkListEntries(
needs_relayout = true; needs_relayout = true;
} else if (no_cellular_networks_view_) { } else if (no_cellular_networks_view_) {
scroll_content()->RemoveChildView(no_cellular_networks_view_); scroll_content()->RemoveChildView(no_cellular_networks_view_);
delete no_cellular_networks_view_;
no_cellular_networks_view_ = NULL; no_cellular_networks_view_ = NULL;
needs_relayout = true; needs_relayout = true;
} }
...@@ -638,6 +640,7 @@ bool NetworkStateListDetailedView::UpdateNetworkListEntries( ...@@ -638,6 +640,7 @@ bool NetworkStateListDetailedView::UpdateNetworkListEntries(
needs_relayout = true; needs_relayout = true;
} else if (no_wifi_networks_view_) { } else if (no_wifi_networks_view_) {
scroll_content()->RemoveChildView(no_wifi_networks_view_); scroll_content()->RemoveChildView(no_wifi_networks_view_);
delete no_wifi_networks_view_;
no_wifi_networks_view_ = NULL; no_wifi_networks_view_ = NULL;
needs_relayout = true; needs_relayout = true;
} }
...@@ -650,6 +653,7 @@ bool NetworkStateListDetailedView::UpdateNetworkListEntries( ...@@ -650,6 +653,7 @@ bool NetworkStateListDetailedView::UpdateNetworkListEntries(
needs_relayout = true; needs_relayout = true;
} else if (scanning_view_ != NULL) { } else if (scanning_view_ != NULL) {
scroll_content()->RemoveChildView(scanning_view_); scroll_content()->RemoveChildView(scanning_view_);
delete scanning_view_;
scanning_view_ = NULL; scanning_view_ = NULL;
needs_relayout = true; needs_relayout = true;
} }
......
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