From 1beb2975bfd49c647462bdb32fc4ae3387a2b4d3 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 24 Oct 2013 21:45:19 +0000 Subject: [PATCH] Merge revision 1487 changes: - Fix memory corruption in browser-initiated CefURLRequests (issue #1118). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1547@1489 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/browser_urlrequest_impl.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libcef/browser/browser_urlrequest_impl.cc b/libcef/browser/browser_urlrequest_impl.cc index cc2d70d3e..949198617 100644 --- a/libcef/browser/browser_urlrequest_impl.cc +++ b/libcef/browser/browser_urlrequest_impl.cc @@ -371,7 +371,10 @@ CefURLFetcherDelegate::~CefURLFetcherDelegate() { void CefURLFetcherDelegate::OnURLFetchComplete( const net::URLFetcher* source) { - context_->OnComplete(); + // Complete asynchronously so as not to delete the URLFetcher while it's still + // in the call stack. + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&CefBrowserURLRequest::Context::OnComplete, context_)); } void CefURLFetcherDelegate::OnURLFetchDownloadProgress(