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

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: 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..99e324b2b5adef3bb0df5031b09a4cae0b78d1ed 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -212,8 +212,12 @@ 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.
instance_ = NULL;
+
+ delete instance_;
piman 2016/08/16 22:04:52 This would delete nullptr, i.e. leak - did you mea
Khushal 2016/08/16 22:11:58 Umm, yes. :l Done.
}
BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory()
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698