In CefContext::RemoveBrowser() allow the call to webkit_glue::ClearCache() to be executed immediately if we're already on the UI thread (which is the case when called "from" CefShutdown()), instead of being posted as a delayed task to avoid a thread death race condition (issue #277).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@273 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-08-03 16:24:38 +00:00
parent 3b34f0014d
commit dadd852cd3
1 changed files with 6 additions and 2 deletions

View File

@ -565,9 +565,13 @@ bool CefContext::RemoveBrowser(CefRefPtr<CefBrowserImpl> browser)
} }
if (empty) { if (empty) {
if (CefThread::CurrentlyOn(CefThread::UI)) {
webkit_glue::ClearCache();
} else {
CefThread::PostTask(CefThread::UI, FROM_HERE, CefThread::PostTask(CefThread::UI, FROM_HERE,
NewRunnableFunction(webkit_glue::ClearCache)); NewRunnableFunction(webkit_glue::ClearCache));
} }
}
return deleted; return deleted;
} }