mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Windows: cefclient: Fix assertions with --use-views --multi-threaded-message-loop
This commit is contained in:
@@ -107,8 +107,7 @@ class ClientRequestContextHandler : public CefRequestContextHandler,
|
||||
} // namespace
|
||||
|
||||
RootWindowManager::RootWindowManager(bool terminate_when_all_windows_closed)
|
||||
: terminate_when_all_windows_closed_(terminate_when_all_windows_closed),
|
||||
image_cache_(new ImageCache) {
|
||||
: terminate_when_all_windows_closed_(terminate_when_all_windows_closed) {
|
||||
CefRefPtr<CefCommandLine> command_line =
|
||||
CefCommandLine::GetGlobalCommandLine();
|
||||
DCHECK(command_line.get());
|
||||
@@ -354,8 +353,11 @@ CefRefPtr<CefRequestContext> RootWindowManager::GetRequestContext(
|
||||
}
|
||||
|
||||
scoped_refptr<ImageCache> RootWindowManager::GetImageCache() {
|
||||
REQUIRE_MAIN_THREAD();
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
if (!image_cache_) {
|
||||
image_cache_ = new ImageCache;
|
||||
}
|
||||
return image_cache_;
|
||||
}
|
||||
|
||||
@@ -446,6 +448,10 @@ void RootWindowManager::CleanupOnUIThread() {
|
||||
temp_window_.reset(nullptr);
|
||||
}
|
||||
|
||||
if (image_cache_) {
|
||||
image_cache_ = nullptr;
|
||||
}
|
||||
|
||||
// Quit the main message loop.
|
||||
MainMessageLoop::Get()->Quit();
|
||||
}
|
||||
|
Reference in New Issue
Block a user