From bd0c16ae317990aa414780e32dc2be6cffbba3a5 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 3 Feb 2010 18:56:17 +0000 Subject: [PATCH] libcef: - Fix race condition in CefUrlRequestJob::AsyncResolver. (Issue #65, fix by heshiming) git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@69 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/scheme_impl.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libcef/scheme_impl.cc b/libcef/scheme_impl.cc index fcabaddd1..c037bdd39 100644 --- a/libcef/scheme_impl.cc +++ b/libcef/scheme_impl.cc @@ -180,6 +180,9 @@ private: void Resolve(const GURL& url) { AutoLock locked(lock_); + if (!owner_ || !owner_loop_) + return; + ////////////////////////////////////////////////////////////////////////// // safe to perform long operation here CefRefPtr req(CefRequest::CreateRequest()); @@ -207,9 +210,8 @@ private: void Cancel() { owner_->handler_->Cancel(); - owner_ = NULL; - AutoLock locked(lock_); + owner_ = NULL; owner_loop_ = NULL; }