Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 2250473005: content: Fix Context creation logic in ContextProviderFactoryImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: run the callback once, fix comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 345ad2a4f423957b4e60b9751365084ef4b0a464..edc79849be8198d31addc3b18ee311b125a85cb8 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -212,8 +212,13 @@ void BrowserGpuChannelHostFactory::Initialize(bool establish_gpu_channel) {
void BrowserGpuChannelHostFactory::Terminate() {
DCHECK(instance_);
- delete instance_;
+
+ // Reset the |instance_| first so we don't receive any more Gpu Channel
+ // initialization requests as we run the existing callbacks.
+ BrowserGpuChannelHostFactory* current_instance = instance_;
instance_ = NULL;
+
+ delete current_instance;
}
BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory()

Powered by Google App Engine
This is Rietveld 408576698