summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorsdoyon@chromium.org <sdoyon@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 15:23:59 +0000
committersdoyon@chromium.org <sdoyon@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 15:23:59 +0000
commitf5b1344709efa31ed597d69717a2bd5299a0aa72 (patch)
tree29f665a67d228e123ad5bbecfac2a50265e66bec /net
parentaaa673b38e02e70dffbf1e6f2996b8477ba072b1 (diff)
downloadchromium_src-f5b1344709efa31ed597d69717a2bd5299a0aa72.zip
chromium_src-f5b1344709efa31ed597d69717a2bd5299a0aa72.tar.gz
chromium_src-f5b1344709efa31ed597d69717a2bd5299a0aa72.tar.bz2
Relax assertion in ProxyConfigServiceLinux gconf cleanup.
To wind down gconf, a cleanup task is posted to the UI thread. Don't assert if that task is destroyed without being run (as may happen on program exit). BUG=16076 TEST=Run "sh tools/valgrind/chrome_tests.sh -t ui", look af the first couple tests and check we don't get this assertion: "proxy/proxy_config_service_linux.cc(211)] Check failed: !client_." Review URL: http://codereview.chromium.org/155363 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/proxy/proxy_config_service_linux.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index 3421110..7c53258 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -205,9 +205,25 @@ class GConfSettingGetterImpl
GConfSettingGetterImpl() : client_(NULL), loop_(NULL) {}
virtual ~GConfSettingGetterImpl() {
- LOG(INFO) << "~GConfSettingGetterImpl called";
// client_ should have been released before now, from
- // Delegate::OnDestroy(), while running on the UI thread.
+ // Delegate::OnDestroy(), while running on the UI thread. However
+ // on exiting the process, it may happen that
+ // Delegate::OnDestroy() task is left pending on the glib loop
+ // after the loop was quit, and pending tasks may then be deleted
+ // without being run.
+ if (client_) {
+ // gconf client was not cleaned up.
+ if (MessageLoop::current() == loop_) {
+ // We are on the UI thread so we can clean it safely. This is
+ // the case at least for ui_tests running under Valgrind in
+ // bug 16076.
+ LOG(INFO) << "~GConfSettingGetterImpl: releasing gconf client";
+ Release();
+ } else {
+ LOG(WARNING) << "~GConfSettingGetterImpl: leaking gconf client";
+ client_ = NULL;
+ }
+ }
DCHECK(!client_);
}