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() |