Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: ash/system/chromeos/network/vpn_list_view.cc

Issue 1410033002: Fix occasional crash in ~VPNListView during shell destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/network/vpn_list_view.cc
diff --git a/ash/system/chromeos/network/vpn_list_view.cc b/ash/system/chromeos/network/vpn_list_view.cc
index d3f30613c085ba7b6079b9e7bc15a2eec37edabd..b6a225076b773188d193a5456aade0bbda2559ee 100644
--- a/ash/system/chromeos/network/vpn_list_view.cc
+++ b/ash/system/chromeos/network/vpn_list_view.cc
@@ -239,10 +239,11 @@ VPNListView::VPNListView(ui::NetworkListDelegate* delegate)
}
VPNListView::~VPNListView() {
- Shell::GetInstance()
- ->system_tray_delegate()
- ->GetVPNDelegate()
- ->RemoveObserver(this);
+ // We need the check as on shell destruction, the delegate is destroyed first.
bartfab (slow) 2015/10/16 15:45:25 You are masking a bug here: VPNDelegate expects al
stevenjb 2015/10/16 16:50:07 This is actually correct (but see note below). *
bartfab (slow) 2015/10/16 16:55:22 VPNDelegate will currently DCHECK() in its destruc
stevenjb 2015/10/16 17:46:18 I see. I think this pattern (without the DCHECK on
emaxx 2015/10/16 17:58:10 Bartosz, first of all, thanks for pointing at the
emaxx 2015/10/16 17:58:10 I think the idea behind the existing code is that
stevenjb 2015/10/16 18:06:40 I'm not sure if that is correct. At one point we s
emaxx 2015/10/28 15:14:38 Done.
+ SystemTrayDelegate* const system_tray_delegate =
+ Shell::GetInstance()->system_tray_delegate();
+ if (system_tray_delegate)
+ system_tray_delegate->GetVPNDelegate()->RemoveObserver(this);
}
void VPNListView::Update() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698